How FileMaker.PerformScript triggers scripts

Be aware how FileMaker.PerformScript triggers a script in FileMaker 19 as they may interrupt other longer scripts running already.

Have you noticed this?

see blog post: How FileMaker.PerformScript triggers scripts

6 Likes

Hello @MonkeybreadSoftware.

Thank you for sharing this with us.

I will watch this topic with interest. If I understand correctly (not certain that I do), it is this absence of queueing the target script invoked from the JS context which makes possible the cool technique that @jwilling shared in this post..

I can definitely see the danger being called out in Christian's blog post, and yet, at the same time, I really like the simplicity of what Josh posted.

If it turns out that the present behavior is here to stay, i.e. (unlike what we are used to with plug-in's), script invocation from FileMaker.PerformScript interrupts a currently running script, then I guess I might start thinking about whether I'd try to get quasi-queuing by having the target of FileMaker.PerformScript invoke a script that uses the Install OnTimer script step to queue a target script. Not sure if I would do that -- just thinking about it, for now. I must say, that I do not relish the idea, as, if implemented to pass payloads and invoke an arbitrary target script, it might require additional mechanisms to be put in place which would spoil some of the simplicity for me.

I look forward to hearing everyone's thoughts on this. Especially if anyone sees this in a way that suggests that some of my above thoughts are mistaken, I hope to read what others have to share.

Thanks again @MonkeybreadSoftware (and @jwilling, for the other post).

1 Like

Terrific information. thanks for letting us know.

1 Like

I agree it's a little funky for scripts called from webviewers to be LIFO.

On the other hand, it sorta makes sense to me that a webviewer should be in charge of "awaiting" results from FM scripts if it needs scripts to run in a certain order. I haven't messed with it much, but it should manageable with promises. Perhaps something of this nature: FileMaker.PerfomScript Javascript class extended - 1-more-thing

1 Like

Well, this may be unexpected or undocument behavior.
Claris can document it and declare it a feature.
Or put choice back to developer with an optional new parameter to define whether it should run now, later or while next script pause.

2 Likes