Attribute Data Type:
Attribute Default Value:
Attribute Inherited from Preferences?
Attribute First Added:
Action code expression used for post-import processing of $AutoFetch content.
If $AutoFetchCommand is empty (the default), $AutoFetch behaves as normal; the contents of the specified URL are stored in the note's text.
$AutoFetchCommand is an action, and thus uses the same syntax as agent actions and rules. It runs when the file is loaded, exported, and possibly during idle period s while the document is open. Typically, $AutoFetchCommand will invoke an outside program, perhaps fetching some information from the user's hard disk or network. For example:
$Text=runCommand("echo | ls ~"/Documents);
either of the above will replace the text of the note with a list of all the files currently in the user's Documents folder (the latter syntax is the recommended choice).
will run the shell script myDatabaseQuery in the user's OS home folder, passing it the value of the note's $TrackingID attribute as an argument.
When accessing the command line this way the current working directory is '/', i.e. the root of the current volume. Thus if calling scripts elsewhere (e.g. in your own user account's documents) remember to prefix an appropriate path to the script.