8.5
Table Of Contents
- Table of Contents
- Welcome to PReS Workflow 8.5
- System Requirements
- Basics
- Features
- The Nature of PReS Workflow
- About Branches and Conditions
- Configuration Components
- Connect Resources
- About Data
- About Documents
- Debugging and Error Handling
- The Plug-in Bar
- About Printing
- About Processes and Subprocesses
- Using Scripts
- Special Workflow Types
- About Tasks
- Task Properties
- Variable Properties
- Working With Variables
- About Configurations
- About Related Programs and Services
- The Interface
- Copyright Information
- Legal Notices and Acknowledgements
Using Scripts
Scripts can be used to perform various operations, such as to manipulate data, for example. PReS Workflow
can perform scripts written in four different scripting languages and also provides an interface for editing
scripts.
Warning
While this chapter provides some very useful and detailed information about scripting within PReS
Workflow, its focus is to inform you about the features, variables and functions unique to this
environment. This chapter assumes that you have a working knowledge of the scripting language you
wish to use and does not purport to teaching you anything about this language that you don't already
know. Learning any of these language is beyond the scope of this documentation.
There are four scripting languages available through the Run Script task: JavaScript, VBScript, Python and
Perl. Each language has its own strengths and weaknesses which we will not cover in this documentation.
While VBScript is the most used language at the moment, the examples provided in this chapter are
presented in all supported languages.
Note
While JavaScript and VBScript are natively available on Windows operating systems. Python and Perl
require third-party tools to be functional. For Perl, ActivePerl can be installed. For Python
ActivePython (version 2.7.13 ) can be installed.
When using the Run Script as a condition, you need a way to tell your process whether the result is true or
false. The condition result is returned by the "Script.ReturnValue" on page106 variable. If the return value is
zero (the default), the condition is false. Otherwise, it is true.
When using the Run Script as an action task, the job file going out of the Run Script action task will be the
same as the one coming in, unless you have specifically changed it within your script by writing to the file
that is the target of the "Watch.GetJobFileName" on page97 function. The same goes for any job info, local
or global variables, unless you use the "Watch.SetJobInfo" on page101 or "Watch.SetVariable" on
page103 functions to modify them.