8.18/6/2018

The Watch Object

PlanetPress Workflow scripting offers a number of methods of communicating with your process by means of PlanetPress Workflow automation object's methods and functions. The automation object is available in all 4 languages through their own syntax - the examples provided here are for VBScript.

While the functions here are in mixed case to simplify reading, it's important to note that some languages (especially Javascript) are case-sensitive and will require the proper case. Examples in this chapter will always use the proper case when relevant.

Here is a list of the methods and functions that are available to you through the automation object (or "Watch" object). While these examples are all in VBScript, you can click on any variable name to open a page to see examples for each supported language.

Variable Name Description
Example Usage (VBScript)
Watch.GetJobFileName Retrieves a string containing the job path and filename located in the job spool folder.
Example Usage: str = Watch.getjobfilename
Watch.GetOriginalFileName Retrieves a string containing the job's original path and filename. Note: this filename is generally no longer available if it has been captured by Watch.
Example Usage: str = Watch.getoriginalfilename
Watch.GetMetadataFilename Retrieves a string containing the job's metadata path and filename. This is useful when using the Metadata API in your script.
Example Usage: str = Watch.getmetadatafilename
Watch.GetJobInfo Retrieves the content of a numbered job info (%1 to %9).
Example Usage: str = Watch.getjobinfo(9)
Watch.GetVariable Retrieves the content of a local or global variable by name.
Example Usage: str = Watch.getvariable("Varname")
Watch.ExpandString Retrieves the content of any Workflow string, containing any variable available to Watch, including data selections.
Example Usage: watchDate = Watch.expandstring("%y-%m-%d")
Watch.Log Writes to the Workflow log file, or the message window when in debug -  can accept multiple log levels from 1 (red) to 4 (gray).
Example Usage: Watch.log "Hello, World!",1
Watch.ShowMessage Displays a popup dialog box to the user (user has to be logged on).
Example Usage: Watch.showmessage("Hello, World!")
Watch.InputBox Prompts the user for a string and returns the value (will not work when running as a service)
Example Usage: str = Watch.inputbox("Caption","Message","default")
Watch.SetJobInfo Writes the value of a string to a numbered job info.
Example Usage: Watch.setjobinfo 9, "String"
Watch.SetVariable Writes the value of a string to a local or global variable by name.
Example Usage: Watch.setvariable "global.GlobalVar", "Hello World!"
Watch.Sleep Pauses all processing for X milliseconds.
Example Usage: Watch.sleep(1000)
Watch.ExecuteExternalProgram Calls and executes an external program in the command line.
Example Usage: Watch.executeexternalprogram "del *.ps" "c:\" 0 true
Script.ReturnValue Returns a boolean True or False value to a Workflow scripted condition
Example Usage:

Script.returnvalue = 1

Watch.GetPDFEditObject Is used to manipulate PDF files using the AlambicEdit API.

See the AlambicEdit API for more information.