This function will allow a script to be run from a calculation.
Actr_RunScript ( switches ; fileName ; scriptName ; scriptParam )
|switches||not used, reserved for future use. Leave blank or put "-unused"|
|fileName||the name of the file that contains the script|
|scriptName||the name of the script|
|scriptParam||(optional) a free to use text that will be the incoming script parameter|
Data type returned
If successful an eventID is returned: this is an internal eventID that the plug-in assigns, for example 4242.
If unsuccessful it returns an error code starting with $$ and the error code. Returned error codes can be:
|$$-50||parameter error, check if your parameters are correct|
|$$-41||not enough memory|
Other errors may be returned.
Activator Plug-in 2.6
FileMaker Pro 12 to 16
NOTE: the plug-in does not store the information of this function, so you don’t need to delete anything after the script has triggered.
See the Tooltips.fmp12 example for hints how to implement this.
See Actr_ScheduleEvent if you want to schedule a script trigger in the future.
Set Field [ result ; Actr_RunScript ( "-unused" ; "Tooltips.fmp12" ; "RunScript1" ; "hello" ) ]
This command triggers the script “RunScript1” in file “Tooltips.fmp12”. Note that this example is somewhat simplified, normally you should not use hardcoded filenames like in the above example. See also example 2, for a more robust example.
We assume that in your FileMaker file the following fields are defined:
gEventID Global, number
Add the following script step:
Set Field [ gEventID ; Actr_RunScript ( "-unused" ; Get ( FileName ) ; "RunScript1" ; "Check record please." ) ]
This command will directly trigger the script “RunScript1” in the current file.