|
We just installed v17 from v16/15. I need help with adding some commands to the autoscript.sbs (previously in older versions of SPSS in the C:\Program Files\SPSS\Scripts folder), however that file is no longer located in the C:\Program Files\SPSSInc\Statistics17\scripts folder. I'm assuming this file changed with the newer versions, but I to figure out where to copy the command lines. I previously had help from Raynald Levesque back in 2004/02/03 which helped auto-insert a page break on a table when the title had 'break' on the table. Here is a copy of what the command section I usually add to the autoscript.sbs file when updating to a newer version of SPSS:
**************************************************************************** Sub Summarize_Table_Report_Create(objTable As Object, objOutputDoc As Object, lngIndex As Long) 'Autoscript 'Trigger Event: Report Table Creation after running Summarize procedure. 'Effects: Goes through the Row Labels and finds "Total" rows and turns "Total" and 'associated data cells bold if the title begins with "/bold/" ' if the title begins with /break/ then a Page Break is inserted immediately before the Summarize table. ' If you want to use both /break/ and /bold/ you need to start the title by "/break//bold/" 'Author: Raynald Levesque 2004/02/03 Dim bolSelection As Boolean Dim i As Integer Dim objitem As ISpssItem Set objitem = objOutputDoc.Items.GetItem(lngIndex) With objitem If (Left(.Label,7) = "/break/") Then objitem.PageBreak =True .Label = Mid(.Label, 8) objTable.TitleText = Mid(objTable.TitleText, 8) End If If (Left(.Label,6) = "/bold/") Then Call SelectRowLabelsAndData(objTable, "Total", bolSelection) If bolSelection = True Then objTable.TextStyle = SpssTSBold End If .Label = Mid(.Label, 7) objTable.TitleText = Mid(objTable.TitleText, 7) End If .Activate .Deactivate End With Set objitem = Nothing End Sub Thanks, Nathan R. Canfield Evaluation Senior Associate Region 3 Behavioral Health Services P.O. Box 2555 Kearney, NE 68848-2555 E-mail: [hidden email]<mailto:[hidden email]> Phone: (308) 237-5113 ext. 231 Fax: (308) 236-7669 Web: www.region3.net<http://www.region3.net/> ________________________________ CONFIDENTIALITY NOTICE: This communication and any files or attachments transmitted with it may contain information that is confidential, privileged and exempt from disclosure under applicable law. It is intended solely for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any unauthorized review, use, disclosure, dissemination, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender by reply e-mail and destroy all copies of the original message. Additionally, we will take the appropriate action to avoid sending you an unintended e-mail in the future. Thank you for your cooperation. ====================To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
Nathan,
Autoscripts have changed their behavior somewhat; see the Help topic "Compatibility with Versions Prior to 16.0" for more information. Autoscripts custom-written for SPSS 15.0 will need to be converted. In particular, look at the details for "Legacy Autoscripts" to get started on the conversion. Here is a portion of that topic: Legacy Autoscripts Prior to version 16.0, the scripting facility included a single autoscript file containing all autoscripts. For version 16.0 and above there is no single autoscript file. Each autoscript is now stored in a separate file and can be applied to one or more output items, in contrast to pre-16.0 versions where each autoscript was specific to a particular output item. Some of the autoscripts installed with pre-16.0 versions are available as a set of separate script files located in the Samples subdirectory of the directory where SPSS Statistics is installed. They are identified by a filename ending in Autoscript, with a file type of wwd. By default, they are not associated with any output items. The association is done from the Scripts tab of the Options dialog. See Script Options for more information. Any custom autoscripts used in pre-16.0 versions must be manually converted and associated with one or more output items, from the Scripts tab of the Options dialog. The conversion process involves the following steps: * Extract the subroutine specifying the autoscript from the legacy Autoscript.sbs file and save it as a new file with an extension of wwd or sbs. The name of the file is arbitrary. * Change the name of the subroutine to Main and remove the parameter specification, keeping track of which parameters are required by the script, such as a pivot table that triggers the autoscript. * Use the scriptContext object (always available) to get the values required by the autoscript, such as the output item that triggered the autoscript. * From the Scripts tab of the Options dialog, associate the script file with the desired output object. ... The topic continues with example code to illustrate the process. ____________________________________________________________ John Bauer SPSS Inc. Email: [hidden email] Tel: +1.312.651.3410 / Fax: +1.312.651.3444 <http://support.spss.com/> -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Nathan Canfield Sent: Monday, October 20, 2008 12:06 PM To: [hidden email] Subject: help edit autoscript in v17 We just installed v17 from v16/15. I need help with adding some commands to the autoscript.sbs (previously in older versions of SPSS in the C:\Program Files\SPSS\Scripts folder), however that file is no longer located in the C:\Program Files\SPSSInc\Statistics17\scripts folder. I'm assuming this file changed with the newer versions, but I to figure out where to copy the command lines. I previously had help from Raynald Levesque back in 2004/02/03 which helped auto-insert a page break on a table when the title had 'break' on the table. Here is a copy of what the command section I usually add to the autoscript.sbs file when updating to a newer version of SPSS: **************************************************************************** Sub Summarize_Table_Report_Create(objTable As Object, objOutputDoc As Object, lngIndex As Long) 'Autoscript 'Trigger Event: Report Table Creation after running Summarize procedure. 'Effects: Goes through the Row Labels and finds "Total" rows and turns "Total" and 'associated data cells bold if the title begins with "/bold/" ' if the title begins with /break/ then a Page Break is inserted immediately before the Summarize table. ' If you want to use both /break/ and /bold/ you need to start the title by "/break//bold/" 'Author: Raynald Levesque 2004/02/03 Dim bolSelection As Boolean Dim i As Integer Dim objitem As ISpssItem Set objitem = objOutputDoc.Items.GetItem(lngIndex) With objitem If (Left(.Label,7) = "/break/") Then objitem.PageBreak =True .Label = Mid(.Label, 8) objTable.TitleText = Mid(objTable.TitleText, 8) End If If (Left(.Label,6) = "/bold/") Then Call SelectRowLabelsAndData(objTable, "Total", bolSelection) If bolSelection = True Then objTable.TextStyle = SpssTSBold End If .Label = Mid(.Label, 7) objTable.TitleText = Mid(objTable.TitleText, 7) End If .Activate .Deactivate End With Set objitem = Nothing End Sub Thanks, Nathan R. Canfield Evaluation Senior Associate Region 3 Behavioral Health Services P.O. Box 2555 Kearney, NE 68848-2555 E-mail: [hidden email]<mailto:[hidden email]> Phone: (308) 237-5113 ext. 231 Fax: (308) 236-7669 Web: www.region3.net<http://www.region3.net/> ________________________________ CONFIDENTIALITY NOTICE: This communication and any files or attachments transmitted with it may contain information that is confidential, privileged and exempt from disclosure under applicable law. It is intended solely for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any unauthorized review, use, disclosure, dissemination, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender by reply e-mail and destroy all copies of the original message. Additionally, we will take the appropriate action to avoid sending you an unintended e-mail in the future. Thank you for your cooperation. ======= To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
| Free forum by Nabble | Edit this page |
