Creating and Editing Scripts

Top   Previous   Next

When you are ready to create a script, or edit an existing script, select the Create and Edit Scripts menu item from the Scripts menu.  This will open the Script Editor Dialog as shown below.

 

Script Editor Dialog - New Script
Script Editor Dialog - New Script


 

Script Details

The Script Details section will show the script as it is currently written.  The first line contains the name of the script.  If the script has not been saved, the name will be Untitled.  Each action will be on it's own line below the name of the script as shown below.  The step number of the action will be before the name of the action. The parameters of each action will be shown after the action name in parenthesis.  When an action is indented under the action above it, the indentation indicates that the indented action will be run only if the action above it fails.  For an example, see the End Script action which is indented below the Check Property action.  You can select any row to view information about the action in the Selected Action Details.

 

Script Editor Dialog with a Script Defined
Script Editor Dialog with a Script Defined


 

Selected Action Details

The Selected Action Details section, gives you the ability to review the

 

Action Target

The Action Target tells you which screen is currently active.  You can use the active target information to look up information about the available actions in this help manual.  Each target is described in the Available Script Actions section of the manual.

 

Action to Perform

The Action to Perform is a drop down list which lists all of the available actions you can use on the specified target.  You can change between the available actions to select the action appropriate for your needs.  The functionality of each action is described in the Available Script Actions section of the manual.

 

Handle action failure with separate action

This setting allows you to control whether or not you want to branch your script if a failure occurs during the action.  Actions can fail for specific reasons.  For example, if you use an action to select a row and that row does not exist, the action will fail.  Using a failure action gives you a chance to recover from the failure.  If you choose not to handle failures with a separate action, the script will simply continue to run.  Please be aware that not handling the failure may lead to additional failures.

 

Parameters

The parameters table lists the parameters which need to be filled out for the action to run.  In many cases, the valid values for a parameter will be provided for you and when you select the parameter, zsDuplicateHunter will display a drop-down list of the valid values which you can select from.  If the valid values are not provided, you can simply type them in. When specifying parameter values, you can specify a variable by surrounding the variable name with curly braces.  For example, specifying {current row} will use the value of the current row variable if it has been defined.  Variable names are not case sensitive when used to fill out parameter values.

 

Insert Action Before

The Insert Action Before button will insert an action before the currently selected action.  The action inserted will be a Pause action.

 

Insert Action After

The Insert Action After button will insert an action after the currently selected action.  The action inserted will be a Pause action.

 

Delete Action

The Delete Action button will delete the currently selected action.  You cannot delete the last action in a script or branch of a script, and you cannot delete an action which is a transition between dialogs or areas within dialogs.

 

Update Action

The Update Action button will save any information you have made to the current action and it will leave the selected action set as it was.

 

Update Action and Move to Next

The Update Action and Move to Next button will save any information you have made to the current action and it will move the currently selected action to the next action in the list.  This is the most efficient way to create scripts.

 

New Script

You can create a new script which clears the script which is currently loaded by selecting the New Script button.

 

Saving and Loading Scripts

You can save and reload scripts using the Save Script, Save Script As and Load Script buttons.  When you save a script, you will be prompted for the name of the file to save to.  This name will also be used as the name of the script in the Script Editor.  Be sure to update any changes you have made to the current script before saving.  If you use the Save Script As button you will always be prompted for the name of the file.  With the Save Script button, you will only be prompted if the script has never been saved before.  When you load a script, you will be prompted for the file to load.  The file will be read by zsDuplicateHunter and loaded into the user interface replacing any information that was in the editor previously.  You can control the default location for the scripts in the Script Options section of the Options Dialog.

 

Running the Script

To run a script, simply select the Run Script button.  This will temporarily hide the Script Editor and start the script.  After the script is complete, the results of the script will be shown.  You can control the location where the results are written as well as how the results are displayed in the Script Options section of the Options Dialog.