Actr_RunScript (function reference)

Activator Plug-in for FileMaker Pro

Actr_RunScript

This function will allow a script to be run from a calculation.

SyntaxFunction badge

Actr_RunScript ( switches ; fileName ; scriptName ; scriptParam )

Parameters

switchesnot used, reserved for future use. Leave blank or put "-unused"
fileNamethe name of the file that contains the script
scriptNamethe name of the script
scriptParam(optional) a free to use text that will be the incoming script parameter

Returned Result

Data type returned

Text

Result

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:

$$-50parameter error, check if your parameters are correct
$$-41not enough memory

Other errors may be returned.

Originated in

Activator Plug-in 2.6

Compatibility

FileMaker Pro 12 to 16

Considerations

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.

Example

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.

Example 2

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.

Related functionsFunction badge

Actr_Control
Actr_ScheduleEvent

Related topics

Activator Plug-in online help (overview)


Online Help Page for Activator Plug-in for 12 to 16 –> Actr_RunScript (actrp4620) 2017-0822 17:26:28