PowerSurge Publishing

 

Products | PSTextMerge | Operating Guide

PSTextMerge Script Tab

Scripting Tab

This tab allows the user to record and playback sequences of PSTextMerge commands. The following buttons and menu commands are available.

Record

Clicking on this button once causes the program to begin recording your subsequent actions as part of a script that can be edited and played back later. This function may also be invoked via the Script/Record Menu item, or with the R shortcut key. You will need to specify the location and name for your script file. It is recommended that ".tcz" be used as a file extension for PSTextMerge script files. This will be supplied as a default if no extension is specified by the user.

Stop

Clicking on this button causes recording of the current script to stop. This function may also be invoked via the Script/End Recording Menu item, or with the E shortcut key. The script file will be closed, and can now be opened for editing, if desired, using the text editor, spreadsheet or database program of your choice.

Play

This button allows you to select a script file to be played back. This function may also be invoked via the Script/Play Menu item, or with the P shortcut key. At the end of a script's execution, the input file options will be reset to their initial default values, to ensure consistent execution when multiple scripts are executed consecutively.

Play Again

This button allows you to replay the last script file either played or recorded. Using this button allows you to bypass the file selection dialog. It can be handy if you are developing, modifying or debugging a series of actions and associated files. This function may also be invoked via the Script/Play Again Menu item, or with the A shortcut key.

Play Recent

This menu item, within the Script menu, allows you to select a recently played script to run. The most recent 10 scripts will be available to select from.

Script File

The script file is itself a tab-delimited text file, and you can edit one using your favorite tool for such things. You can create one completely from scratch if you want, but it usually easiest to record one first, and then edit the results.

The script file has the following columns.

  1. module — This names the tab to process the command.
  2. action — This names the action to be taken, and usually corresponds to a button on a tab.
  3. modifier — This supplies a value that modifies the intent of the command in some way.
  4. object — The name of the thing to be acted upon.
  5. value — A value that the object is to be set equal to.

Following is a complete list of all the allowable forms for script commands. Constants are displayed in normal type. Variables appear in italics. Blank cells indicate fields that are not applicable to a particular command, and therefore can be left blank or empty. Forward slashes are used to separate alternate values: only one of them must appear (without the slash) in an actual script command. Most of the values correspond directly to equivalent buttons on the tabs, as described elsewhere in this user guide. The one non-intuitive value is probably the Filter values for the andor object: True sets "and" logic on, while False sets "or" logic on.

Note that file names may begin with the literal "PATH" surrounded by "#" symbols. When recording a script, the program will automatically replace the path containing the script file with this literal. In addition, upwards references from the location of the script file will be indicated by two consecutive periods for each level in the folder hierarchy. On playback, the reversing decoding will occur. In effect this means that files within the same path structure as the script file, or a sub-folder, will have their locations identified relative to the location of the script file. Files on a completely different path will have their locations identified with absolute drive and path information. The overall effect of this is to make a script file, along with the input files referenced by the script file, portable packages that can be moved from one location to another, or executed with different drive identifiers, and still execute correctly. Normally all of this will be transparent to the user.

Similarly, the literal "#TEMPLATES#" will be used as a placeholder for the path to the current template library, as set with the Set Template Library button on the Template tab.

module action modifier object value
input open url merge/blank url name
input open file merge/blank file name
input open dir merge/blank directory name
input open html1 merge/blank file name
input open html2 merge/blank file name
input open html3 merge/blank file name
input open xml merge/blank file name
input open xls merge/blank file name
sort add Ascending/ Descending field name  
sort clear      
sort set   params  
combine add   dataloss integer
0 = no data loss, 1 = one record overrides, 2 = allow concatenation
combine add   precedence integer
+1 = later overrides earlier, -1 = earlier overrides later
combine add   minnoloss integer
combine set   params  
filter set   andor True/ False
filter add operator field name comparison value
filter clear      
filter set   params  
output set   usedict True/ False
output open     file name
template open file   file name
template generate      

 

Continue with the Log Tab.

 

Home | Downloads | Donations | Store | Support | Products

Copyright © 1999-2008 Herb Bowie • All rights reserved • E-mail:

http://www.powersurgepub.com/ | script.html | Revised: 11/15/08

Google
WWW PowerSurgePub.com