Basic Actions

Top   Previous   Next

There are several actions you can use which are available on all dialogs.  These actions are described here.

Check Available Script Actions

This action allows you to check which actions are available on the current object which is being scripted.  The list of available actions will be separated with semi-colons.  The list does not include Basic Actions which are included for all objects.

Operation

The operation determines how you want to compare the expected value to the actual value.  The available comparison types are: less than, less than or equal, equal to, greater than or equal, greater than, not equal, equal ignore case, starts with, ends with, and no check.

Expected Value

The expected value tells zsDuplicateHunter what value you are expecting the value to be.

Variable To Set

Optionally specifies a variable to set.  If the Variable To Set is not provided, it will be ignored.  If the Variable To Set cannot be found, it will be created.

 

Check If Variable Is Defined

The Check If Variable Is Defined action allows you to check if a variable has been created already. You can use this action to prevent redefining variables that have been defined earlier or that have been defined by a parent script.

 

Parameter Name

Description

Variable Name

Specifies the name of the variable which will be created.

Expected Result

Specifies if the variable is expected to be defined or not.  Valid values are true and false.

 

Check Clipboard Contents

The Check Clipboard Contents action allows you to check the information which is currently on the system clipboard.

Operation

The operation determines how you want to compare the expected value to the actual value.  The available comparison types are: less than, less than or equal, equal to, greater than or equal, greater than, not equal, equal ignore case, starts with, ends with, and no check.

Expected Value

The expected value tells zsDuplicateHunter what value you are expecting the value to be.

Variable To Set

Optionally specifies a variable to set.  If the Variable To Set is not provided, it will be ignored.  If the Variable To Set cannot be found, it will be created.

 

Check Current Object Name

This action allows you to check the name of the object which is currently active within the script.

Operation

The operation determines how you want to compare the expected value to the actual value.  The available comparison types are: less than, less than or equal, equal to, greater than or equal, greater than, not equal, equal ignore case, starts with, ends with, and no check.  

Expected Value

The expected value tells zsDuplicateHunter what value you are expecting the value to be.

Variable To Set

Optionally specifies a variable to set.  If the Variable To Set is not provided, it will be ignored.  If the Variable To Set cannot be found, it will be created.

 

Check File Information

The Check File Information action allows you to find information about the files and folders on your system.  You can use this to ensure that information has been written correctly, or to evaluate files which will be compared.

 

Parameter Name

Description

File to Check

The full path to the file you wish to check.

Property to Check

Specifies which property of the file should be checked.  Valid values are:

Attributes - Returns the attributes of the file.

Checksum-Adler32, Checksum-CRC32 - Returns the checksum as a hexadecimal number

Creation Date - Returns the time when the file was last modified formatted according to the formatting which is set in the options.

Digest-MD5, Digest-SHA-1, Digest-SHA-256, Digest-SHA-384, Digest-SHA-512 - Returns the digest as a hexadecimal number

Exists - Returns whether or not the file exists, valid values are true and false.

Is Alias - Returns whether or not the file is an alias or shortcut.  Valid values are true and false.

Is Directory - Returns whether or not zsDuplicateHunter will treat the file as a directory.  Note, Zip Files as files even though they can be opened as directories depending on the comparison options.  Valid values are true and false.

Is Empty - Returns whether or not the directory is empty.  If the setting Treat Folders With Hidden Files Only As Empty (In the File Deletion Options) has been turned on, this property will include that criteria in the check.  Valid values are true and false.

Is File - Returns whether or not zsDuplicateHunter will treat the file as a file.  Note, Zip Files as files even though they can be opened as directories depending on the comparison options.  Valid values are true and false.

Is Hidden File - Returns whether or not the file is a hidden file.  Valid values are true and false.

Is Removable Media - Returns whether or not the file is on removable media like a CD or Floppy disk.  Valid values are true and false.

Is System File - Returns whether or not the file is a system file.  Valid values are true and false.

Last Modified Time - Returns the time when the file was last modified formatted according to the formatting which is set in the options.

Number of Children - Returns the number of files and folders which are contained within the directory.

Size - Returns the size of the file in bytes.

Type - Returns the type of the file.  Valid values are File, Folder, Zip File, Zip File Entry, Snapshot, Snapshot Entry

Operation

The operation determines how you want to compare the expected value to the actual value.  The available comparison types are: less than, less than or equal, equal to, greater than or equal, greater than, not equal, equal ignore case, starts with, and ends with.

Expected Value

The expected value tells zsDuplicateHunter what value you are expecting the value to be.

 

Check Variable

The Check Variable action allows you to check the contents of a variable. In most cases, you will want to handle the failure of the check using a separate action.  The available variables will depend upon the variables that have been defined.  The action will fail if the comparison does not work, or if the Variable cannot be found.  You can create variables using the Create Variable action.

 

Parameter Name

Description

Variable

The Variable parameter determines which variable you want to check.

Operation

The operation determines how you want to compare the expected value to the actual value.  The available comparison types are: less than, less than or equal, equal to, greater than or equal, greater than, not equal, equal ignore case, starts with, and ends with.

Expected Value

The expected value tells zsDuplicateHunter what value you are expecting the variable to hold.

 

Comment

The Comment action allows you to add a comment to the script.  The comment is echoed to the results file, but does not otherwise effect the script.

 

Parameter Name

Description

Comment

The comment which will be displayed in the script and the results.

 

Compare Files

The Compare Files action does a binary comparison of the two specified files to ensure that they are exactly the same.  This can be very useful to ensure that results files, are the same as expected.

Parameter Name

Description

Expected File

Specifies the full path to the file which contains the expected result.  This is typically created while the script is being created and it is checked manually to ensure the file has the correct information in it.

Actual File

Specifies the full path to the file which contains the actual result.  This is typically created during the script run.

 

Continue

The Continue action will continue execution from the previous location.  This action should always be the last action within a Loop.  It can also be used in the Failure branch of an action to return to the previous line of execution.

 

Copy Files and Folders

The Copy Files and Folders action allows you to copy files and folders from outside of zsDuplicateHunter.  This can be used to copy information which your script relies on. If a folder is specified, the contents of the folder will be copied as well. The action will fail if the file cannot be copied for any reason.

 

Parameter Name

Description

Source File or Folder

Specifies the full path to the file which will be copied.

Destination File or Folder

Specifies the full path to the file which the source file or folder should be copied to.

 

Create Variable

The Create Variable action allows you to create a variable which can be used to store information about the comparisons you are running, or to store a commonly used value. For example, you can store the path to files you are testing in variable and use the variable instead of the entire path.  If the Variable Name has already been created, the variable will be updated with the Initial Value and Is String properties.  Variable Names are not case sensitive.

 

Parameter Name

Description

Variable Name

Specifies the name of the variable which will be created.

Initial Value

Specifies the value that the variable should be set to by default.

Is String

Specifies whether or not the variable should be treated as a string for comparison purposes.  Valid values are yes and no.  If the value is no, the comparison will be done as a number.

 

Delete Files and Folders

The Delete Files and Folders action allows you to delete files and folders from outside of zsDuplicateHunter.  This can be used to clean up files and folders which your script relies on. If a folder is specified, the contents of the folder will be deleted as well. The action will fail if the file cannot be deleted for any reason.

 

Parameter Name

Description

File or Folder to Delete

Specifies the full path to the file or folder which will be deleted.

 

End Script

The End Script action terminates the currently running script.  The End Script action will always be the last action in any script.

 

Go To Step

The Go To Step action allows you to jump to a different section of the script.  This can be used to emulate programming concepts like If Then Else statements, or to exit loops prematurely.  The action will fail if the specified step number cannot be found.  If the action fails, the script will terminate as if End Script were called.  When using the Go To action, please be careful not to setup infinite loops which your script cannot return from.

 

Parameter Name

Description

Step Number

Specifies the step which should be executed next.

 

Loop

The Loop action allows you to loop through a sequence of actions zero or more times.  This can be used to work through the results applying tests and taking appropriate action on each item in the results.  The loop requires variables to use for iteration.  In most programming languages, this Loop would be represented by a for loop.  Other types of loops can be emulated with Go To Step commands.  You can also exit the loop using the Go To Step command.

 

Parameter Name

Description

Loop Variable Name

Specifies the name of the variable which will be used to control the start and end of the loop.  This variable can be referenced from within the loop.  When selecting the Loop Variable Name, take care not to override a loop variable which already exists if you are nesting loops.

Starting Value

Specifies the starting value of the loop.  By default the starting value is zero.  The starting value can be any number or it can be a variable.

End Loop Operation

Specifies the operation that should be used to determine if the Loop should be ended.  The available comparison types are: less than, less than or equal, equal to, greater than or equal, greater than, not equal, and equal ignore case.

Ending Value

Specifies the value at which the loop should end.

Increment Operation

Specifies what should be done to the variable each time a pass through the loop has been completed.  The valid values are Set, Add,  Subtract, Multiply, and Divide.

Increment Value

Depending on increment operation, specifies the value to increment the starting value by each time a pass through the loop has been completed.

 

Pause

The Pause action will pause execution of the current script for a specified number of milliseconds.  One millisecond is 1/1000 of a second.  So to pause for one second, you would want to specify 1000.

 

Parameter Name

Description

Milliseconds to Pause

Specifies the number of milliseconds to pause the script.

 

Set Script Failure

The Set Script Failure action causes a failure to be reported for the script within the report.  This is a shortcut for setting the predefined variable Script Passes to false.  This variable is reported in the report so you can tell at a glance if your script executed as expected.

 

Set Variable

The Set Variable action allows you to update the value of a variable.  Depending on the action selected, you can set the variable to the value of a property or another variable, increment the variable, or decrement the variable.

 

If the Operation is Set , you can set the variable to another variable by enclosing the value in curly brackets {}.  You can also use a combination of a parameter and plain text.  For example, the Value {sample directory}\Sample Directory can be used to specify a path.  The variable {sample directory} will be expanded when the variable is set.  All other values will be used as is.

 

If the Operation is Add and the variable is a string, the value will be appended to the current value.

 

The Operations Subtract, Multiply, and Divide will cause an error if they are used with String variables.  The Divide operation will also cause an error if the specified Value is 0.

 

Parameter Name

Description

Variable Name

Specifies which variable should be changed

Operation

Specifies what should be done while setting the variable.  The valid values are Set, Add,  Subtract, Multiply, and Divide.

Value

Depending on operation, specifies the value to set the variable to.