Users can stop scripts at any point of execution by pressing ‘ESC’. This is FMPs default behaviour. It can be altered by using the ‘Allow User Abort’ step, setting it to ‘Off’. The scope of the ‘off’ setting is script and subscripts.
This script step is the first one in all of my scripts because users should not be able to stop scripts in an uncontrolled way. I would rather have FMP having a file-wide setting for default behaviour and specifically allow user abort, if this is needed for a reason.
How do you handle this FMP feature in your solutions?
I now often encapsulate the Allow User Abort script step in a script to allow for modes such as an override feature for the [Full Access] privilege set (useful for debugging), a push and pull feature for the use of the script step, an explicit debug setting feature, etc.
I also have scripts where breaking their execution is not problematic at all… so I don't put this script step in them.
Lastly, I sometime use a strategy where initial calling scripts make the determination as to whether sub-scripts allow user abortion or not. This is particularly feasible with a MVC approach to development.
I hear you. I wish I had the option of telling FileMaker that a script step with the possibility of a Pause does NOT pause by default, and that similarly a script step with the possibility of a dialog does its thing WITHOUT a dialog by default. And error capture, too: if I want to turn it OFF, I'll do so explicitly, but by default it oughta always be ON.
I'm with @bdbd on this. It depends. I like the user to be in charge. In a workflow I may want to prevent the user from aborting a transaction. But the script controlling the transaction could be in a loop. I think the user should be able to interrupt the loop.
Thank you @Malcolm, now I get the meaning of @bdbd’s post and agree. Transactions shall no t be interrupted. Anywhere else, the user maybe entitled to interrupt a script. The primary concern of my post was transactions.
This is one area where when a loop can get out of control, a subscript can be used to either halt script, when needed, or pass back a variable that allows an "Exit Loop If" condition to trigger.
There is also a level of providing a flow that doesn't get blown up by an unexpected exit. Small things even, like supplying a processing layout, that has a button to return home, and shows nothing else...and other such things.