AnsweredAssumed Answered

Install OnTimer Script and optional script parameter bug

Question asked by alex117 on Aug 8, 2016
Latest reply on Aug 31, 2016 by flybynight

Product and version (FileMaker Pro Advanced 15.0.1.119)

OS and version (OS X, El Capitan, 10.11.6)

Hardware (MacBook Pro)

 

Description

The Install OnTimer Script step seems to have a bug involving the “optional script parameter” option available in it. When you specify the “Get ( ScriptParameter )” function as the value for the optional script parameter, the actual value of the script parameter does not pass over into the subscript specified within the Install OnTimer Script step.

 

For example, let’s say you have a simple text expression of "Hello World" defined as the script parameter for a particular script trigger. You then have a timer script with Install OnTimer Script step to run a particular subscript. You want to pass that original "Hello World" script parameter previously mentioned to the subscript. This is normally done by (1) specifying the “Get ( ScriptParameter )” function as the value for the optional script parameter of the Install OnTimer Script step and then (2) using "Get ( ScriptParameter )" again within the subscript to get the original "Hello World" value. In this scenario, the value does not pass on for some reason.

 

*The interesting thing is that the Perform Script step also has an “optional script parameter” option and it allows the use of the “Get ( ScriptParameter )” function as the value for that, and in that instance, the value of the script parameter is actually correctly passed on to the subscript selected.

 

I’m not sure if this is by design, but I cannot find any documentation. It seems more like a bug since the "optional script parameter" option should behave more like the one available in the Perform Script step, but it doesn’t.

 

How to replicate

Please see the attached file.

 

Workaround (if any)

The only way to get the original "Hello World" script parameter over to the subscript of the timer script is to first define a global variable equal to "Get ( ScriptParameter )" and then use that newly created variable as the actual value for the optional script parameter for the main timer script, instead of just using "Get ( ScriptParameter )". This means an extra step, since you don't have to do this in the same option found within the Perform Script step, but it works.

 

I hope FileMaker will look into this and make the behavior of the optional script parameter more consistent and compatible with the "Get ( ScriptParameter )" function since it already works well within the Perform Script step and avoids the extra variable step.

Outcomes