I would like to retrieve and use the Modification Date / Last Modified Date of a file as a SmartName. How can I do that?
Procedure
This can be achieved by setting up a Script SmartName with the following content:
var localfile = "<<filespec/>>".replace("file://", "//");
var file = new java.io.File(localfile);
var dtmModified = file.lastModified()
dtmModified
To get a readable time format, go to Formatting Options... and do the following:
Set Data Format to "Date and Time"
Set Format to "ISO 8601"
Select your Time Zone
In the Input Format Options..., set Format to "UNIX Time (in milliseconds)", as that is the format Automation Engine uses internally for time notifications.
Esko does not provide or support Scripts or guarantee the expected functioning of user scripts. This page merely serves as a tip.