Actr_SendRemoteEvent (function reference)

Activator Plug-in > Functions reference > Actr_SendRemoteEvent
Activator Plug-in for FileMaker Pro

Actr_SendRemoteEvent

Send a message to the computer with this IP address. This message will trigger the specified script.

SyntaxFunction badge

Actr_SendRemoteEvent( switches ; IP_address ; securityID ; fileName ;
scriptName ; yourID ; usertext )

Parameters

switchessee below
IP_addressthe IP address of the computer that must be triggered
securityID(optional) an ID that must be equal to the securityID of the receiving computer
fileNamethe name of the file that contains the script
scriptNamethe name of the script
yourIDa free to use ID that you can supply to identify the event
usertexta free to use text that you can supply for your own needs

Switches

switches can be one of this:

-DefaultPortnumberuse the default port number of the Activator (UDP port 54242)
-PortNumber =use the specified portnumber

additionally you can add:

-DontGoToForegroundthe script triggers whithout the plug-in first bringing FileMaker (or Runtime) to the foreground
-SilentEventdo not trigger a script, just send the data

Returned Result

Data type returned

Error code

Result

If successful it returns 0.
If unsuccessful it returns an error code starting with $$ and the error code. Returned error codes can be:

$$-50parameter error. There was an error with the parameters
$$-4228portnumber out of range: use 0 to 65535

Other errors may be returned. See our OSErrrs database for explanations.

Originated in

Activator Plug-in 1.2

Compatibility

FileMaker Pro 12 to 16

Considerations

You can omit both portnumber switches. In this case the default portnumber 54242 is used.

The securityID makes listening for messages safer. No one can trigger a script on a remote computer, unless they know the securityID. If the sender sends a different securityID no triggering occurs. See “Actr-StartListener” for more information on SecurityID.

The maximum length of a remote message is 6000 characters. To accomodate the name of the script etc, this means that you should not send usertext that is longer than 5000 characters.

When you add the -SilentEvent switch, the receiver application won’t be notified, so you need to make sure the event data is retrieved, with the -FirstSilentEvent switch in the Actr-GetEventInfo function. Also don’t forget to delete this event.

The -DontGoToForeground switch adds the possibility to do background processing, for example with a FileMaker Runtime application. See the example in the Background Processing folder.

Example

Set Field [ gErrorCode ; Actr_SendRemoteEvent ( "-DefaultPortnumber ; 192.168.1.1 ; secretword ; 
			Filename.fmp12 ; Triggerscript1 ; 1234567 ; Hello there!" ) ]

Example 2

We assume that in your FileMaker file the following fields are defined:

gIPAddress		Global, text
gSecurityID         	Global, text
gYourID    		Global, text
gYourText  	  	Global, text
gErrorCode		Global, text

gIPAddress and gSecurityID should contain the IP address resp. the SecurityID of the computer you want to trigger. gYourID and gYourText can be filled with the message you want to send to the other computer. Add the following script step:

Set Field [ gErrorCode ; Actr_SendRemoteEvent ( "-PortNumber =51000" ; gIPAddress ; gSecurityID ; 
			"Remote.fmp12" ; "Triggerscript1" ; gYourID ; gYourText ) ]

This will trigger script “Triggerscript1” in database “Remote.fmp12” on the remote computer.

Related functionsFunction badge

Actr_DeleteEvent
Actr_StartListener

Related script stepScript step badge

Send Remote Script Trigger

Related topics

Activator Plug-in online help (overview)


Online Help Page for Activator Plug-in for 12 to 16 –> Actr_SendRemoteEvent (actrp4615) 2017-0831 20:22:00