Script Properties Window
The Script Properties Window contains the settings and code for a script that is stored in adTempus.
Property Pages
Script
Name
Provide a descriptive name for this script. If the script is Shared, a name is required and must be unique across all shared scripts. Otherwise the name is optional.
Shared
Check this option to allow the script to be shared among jobs, responses, etc. If the script is not Shared it will be available only for the object with which it is associated.
When a script is shared the Security page will be visible (see below), allowing you to specify permissions for the script.
Once you have checked the Shared option and saved the script, the script cannot be "unshared." If you no longer want it to be shared you must delete it and recreate it.
Description/Notes
Enter any extended descriptive information or notes for this script. There is no limit on the length of the text.
Language
Select the language that the script uses. The following languages are supported:
- VBScript
- VB.NET
- C#
- PowerShell (only supported in some contexts)
- Windows batch files (only supported in some contexts)
Framework
Available for .NET (VB.NET and C#) and PowerShell scripts. Requires adTempus server version 6 or later.
- For .NET scripts you can choose to compile and run the script under either .NET Framework (4.8.x) or the newer .NET (no more "Framework" in the name).
- The .NET option will be available only if the required version of the .NET Runtime is installed on the server; it is not installed automatically during installation. More information.
- Any Script Libraries the script references must be valid for the same framework. For example if your script is configured to run under .NET Framework but references a Script Library that uses language features or assemblies from .NET, it will fail. There is no Framework setting for a Script Library; the library is compiled under the framework of the script that references it. Thus the same library can be used for both .NET Framework and .NET scripts as long as its code and referenced assemblies are valid for both.
- For PowerShell scripts you can choose either classic Windows PowerShell or the newer PowerShell (no more "Windows" in the name; also known as PowerShell Core or PowerShell 7+).
- For PowerShell 7+ you must have a suitable version of PowerShell installed for the user whose account the job runs under. For example if PowerShell has been installed per-user for your user account but the job runs under a different user account, it will fail unless PowerShell is installed for that user, or installed for all users. More information.
- Even if you have selected Windows PowerShell, adTempus will check the script for #Requires statements and will use PowerShell if the script requires version 7 or later or requires "PSEdition core".
Included Script Libraries
Your script can make use of code defined in Script Libraries. Select any libraries you want to reference here.
The list of available libraries will depend on your chosen script language:
- For a .NET script (VB.NET, C#), you can reference libraries written in either .NET language.
- For a Windows Script Host script (VBScript, JScript), the library must be written using the same language.
- For a PowerShell script, the library must be written using PowerShell.
Included Scripts
For PowerShell scripts, the Included Scripts section allows you to reference shared PowerShell scripts. Any scripts that you "include" will be written to a temporary folder (identified by the "ADTJobTemp" job variable) while your script is being executed, allowing you to call those scripts from your primary script.
The Call Shared Script drop-down menu in the code editor toolbar will list all scripts available to be referenced. When you select a script from the list, the editor will insert a call to that script at the current cursor location. The following syntax is used to call shared scripts:
& ($adTempus.JobVariables["ADTJobTemp"] + "\included script name.ps1")
Included Batch Files
For batch files, the Included Batch Files section allows you to reference shared batch files. Any batch files that you "include" will be written to a temporary folder (identified by the "ADTJobTemp" job variable) while your batch file is being executed, allowing you to call those batch files from your primary batch file.
The Call Shared Batch drop-down menu in the code editor toolbar will list all batch files available to be referenced. When you select a batch file from the list, the editor will insert a call to that batch file at the current cursor location. The following syntax is used to call shared batch files:
call "%ADTJobTemp%\included batch file name.cmd"
Referenced Assemblies
If you have selected one of the .NET languages, your code may reference other .NET assemblies. The following assembly references are automatically added for all scripts, even though they are not listed here:
- System.dll
- System.Core.dll
- System.Data.dll
- System.Xml.dll
- ArcanaDevelopment.adTempus.ApplicationIntegration.dll
- ArcanaDevelopment.adTempus.ScriptEngine.dll
- ArcanaDevelopment.adTempus.Shared.dll
If your script makes use of any other assemblies, you must explicitly reference them.
Script
Provide the body of the script.
When you initially select the script language, the script body will be filled with a template script for you to use as a starting point. The contents of the template will depend on the context of the script (for example, the template for a Script Execution Task will be different than the template for a Condition Script).
In most cases, your script must return a result to adTempus to indicate the outcome of the script and tell adTempus how to proceed.
Click the new document button on the toolbar to reset the script body to the template for the selected language.
Limit script execution
Specify the maximum time (in minutes) that the script should be allowed to run. (This feature protects against "runaway" scripts.)
If this script is used in a Script Execution Task, which also allows you to specify a time limit, adTempus will use the more restrictive of the maximum run times specified for the Script and the Task.
Use 32-bit script host
When this option is checked, the script will be run as a 32-bit process when run on a 64-bit platform. If this option is not checked, scripts (other than Windows Script Host scripts) run as 64-bit processes. Use this option when your script has a dependency on a 32-bit components, driver, etc.
Windows Script Host scripts (VBScript, JScript) always run as 32-bit, regardless of whether this option is checked.
Validate
Click the Validate button to validate your script (not available for batch files or PowerShell scripts). adTempus will check to ensure that the code is valid.
Test
Click Test to execute your script (not available for batch files). If the script returns a value, that value will be displayed.
Security
The Security page appears only if the script is Shared.
The Security page is used to view or modify the security settings for this object. See the Security Editor topic for more information on editing security settings.
The following permissions apply to scripts:
| Permission | Description |
| Full Control | Permission to perform all actions on the script. |
| List/Use | Permission to use the script. |
| View | Permission to view the properties of the script. |
| Modify | Permission to modify the properties of the script. |
| Delete | Permission to delete the script. |
| Administer security | Permission to change the security settings for the script. |
| Change owner | Permission to take ownership of the script. |
Permission to create new scripts is controlled through the Script Security settings.