BE_ExecuteSystemCommand

BE_ExecuteSystemCommand ( command { ; timeout } )

 

Performs a command line script of the command parameter. Essentially the same as using Terminal on the Mac, or CMD.exe on Windows.

 

Version : 2.0

 

Parameters :
command : the content of the command to run.
timeout ( optional ) : A value, in milliseconds that the plugin should wait for a result before returning. Using a value of -1 will wait forever, until the command finishes. A value of 0 will return to FileMaker immediately, and any other value will wait a maximum of the time in milliseconds or when the command finishes, whichever is first.

 

On Windows you need to prefix your command with "cmd.exe /c". For example "cmd.exe /c dir" will list the directory contents. No prefix is required for Mac.

On the Mac this uses the "sh" shell, which is different from the default Terminal.app shell which is "bash". There can be syntax differences between commands using these shells, so if you find a difference between the two, first try running BE_ExecuteSystemCommand ( "/bin/bash -c \"commandhere\"" ) to see if that removes the difference.

 

Result : the result of the command, if any, up to the point of the timeout. Function calls that have a timeout of 0 will not return any values ( obviously ).

A result of 12000 is a plugin error : Timeout exceeded.

Have more questions? Submit a request

0 Comments

Article is closed for comments.