Start listening for messages from other computers.
Actr_StartListener ( switches ; currentFileName ; securityID )
|switches||determine the behavior of this command|
|currentFileName||the name of the file that contains the script that must be triggered later|
|securityID||(optional) a security ID which the sender needs to add to sent messages|
switches must contain only one of this:
|-Defaultportnumber||use the default port number of the Activator (UDP port 54242)|
|-Portnumber=xxx||use the specified portnumber xxx|
Data type returned
If successful it returns 0.
If unsuccessful it returns an error code starting with $$ and the error code. Returned error codes can be:
|$$-50||paramErr||there was an error with the parameters|
|$$-4228||portnumber out of range: use 0 to 65535|
Activator Plug-in 1.2
FileMaker Pro 15 to 19
Which port you should choose is dependent on your network situation: you should use a port number that is not in use. Try to use the default port number. If this port is occupied choose a number in the private range: 49152 – 65535.
Below you find how ports are currently assigned:
0 – 1023: Well Known Ports, used by standard protocols. Don’t use for Activator.
1024 – 4915: Registered Ports. Not recommended for Activator.
49152 – 65535: Dynamic and/or Private Ports.
The securityID makes listening for messages safe. No one can trigger a script on your computer, unless they know the securityID. If the sender sends a different securityID no triggering occurs!
For the securityID you can for example use (random) numbers or a password, and you can distribute it in a field of a shared database. See the example file “Remote.fmp12”. If you specify an empty securityID all messages will be triggered, even if the sender has included a non-empty securityID.
Set Field [ gErrorCode ; Actr_StartListener ( "-Defaultportnumber" ; Get ( FileName ) ; "12345" ) ]
This will start the listening for messages. Only messages which have securityID 12345 are handled, others will be ignored.
We assume that in your FileMaker file the following fields are defined:
gSecurityID Global, text gErrorCode Global, text
gSecurityID should contain the securityID, for example “secretpassword”. Add the following script step:
Set Field [ gErrorCode ; Actr_StartListener ( "-Portnumber=50505" ; Get ( FileName ) ; gSecurityID ) ]
This will start the listening for messages on port 50505. Only messages which are sent to this port and have securityID that’s equal to the value in field gSecurityID are handled, others are ignored.
Related script step
|Start Message Listener|