Templates

Templates let you insert some text into a property as the action is running. This is useful if you want to include some extra information such as the date or name of a user into the property. An example might be to include a serial number in a file path or the user’s name in a log entry.

Template variables start and end with the sequence ??, the start sequence is then followed by a variable name such as SerialNumber or UserName.

An example is the default value for the Message property of the Log Message action:

New Print: ?? DocumentName ?? from: ?? Username ??.

There are two templates in this text, when a document is printed it will get converted into something like:

New Print: widget orders.xls from: joe.

To control the formatting of template variables use template filters.

Code

Code in templates starts with the sequence ?% and ends with %?. At the moment the only supported feature is to call a PowerShell script:

?% PowerShell("[System.Net.Dns]::GetHostName()") %?

This will call the PowerShell code [System.Net.Dns]::GetHostName() which is itself a call into the .Net framework. The result will be the name of the computer:

Lenovo T460