thanks Beverly and Jason,

Yes, the paused script is the deal.

I believe I'm going to send a request to FM to put a checkbox in preferences to turn "Keep Sorted" off if one wants.

thanks,
Geoff

On Nov 22, 2009, at 1:39 PM, Beverly Voth wrote:

Yes! Good alternative, Jason. :)

On 11/22/09 1:17 PM, "Jason L DeLooze" <[email protected]> wrote in
whole or in part:

If Geoff executed the "Suspend Auto-Sort" directly, the "Allow User Abort" is automatically "On", so he can manually "Cancel" the script. But you are correct that, to be safe, he should take steps to prevent entry into an endless loop that cannot be stopped. [Of course, if he is using FMP Advanced, he could enter the Script Debugger while the loop is running and exit that
way.]

Since I don't like using Modifier Keys in this way, I would suggest a small
change to my original script.

Create the script "Suspend Auto-Sort" as follows:

Loop
  Allow User Abort [On]
  Pause/Result Script [Indefinitely]
End Loop

I placed the AUA [On] within the Loop so that, if Geoff calls another script while Paused, as he might do if he forgets to cancel the loop after he is done editing the Address Line 1 records, and that other script has a Allow User Abort [Off] within it, then he can still escape the endless loop thus created.

Thanks for seeing this hidden pothole, Bev.

Jason


On 11/22/09 at 10:53 AM -0500, Beverly Voth wrote:
Geoff, you may wish to add a "halt process" to the script or have another
script to halt this endless loop!

Loop
 If [ Get( Active ModifierKeys ) = 4 // ctrl key down ]
   Halt Script
 End If
 Pause/Resume Script [ Indefinitely ]
End Loop

While technically you *can* cancel the script running at anytime, because you haven't added "Allow User Abort [Off]". I know I can get myself into trouble if I don't make sure I have a built-in halt process for a loop... :)

Beverly

Reply via email to