Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Methods for controlled abort of script

Featured Replies

Thought I'd see if anyone has any cleaver ways to terminate a script in a controlled manner.

Currently I use the get active modifier keys to accomplish this, pseudo code example:

Allow user abort off

Show message explaining operation and to abort activate caps lock

If caps lock active

tell user to turn it off and try again

Exit Script

EndIf

Loop

Exit loop if caps lock active

Do a bunch of critical scripts that cannot be aborted during their operation

GotoNext Record exit after last

EndLoop

Only problem is one customer who can't seem to grasp the concept of reading messages and understanding the concept of turning off the caps lock.

I like using the caps lock, as some of the critical scripts can take time to complete, and I don't want someone sitting their holding the shift key, or other modifier key.

The scripts have layouts flying around offscreen so I didn't want to go back to the original layout, turn user abort off and pause with delay, allowing the cancel button to show up, as that takes time away from the script when its running.

Just looking for other ways that I've not thought of to do this.

Can you try and explain again what is it you're trying to accomplish? I didn't get what role caps lock plays here. I am not even sure it should play a role in communicating with a script: IOW, what it's to you what my caps lock status is (says the user to the developer)?

Well maybe you could just use a OnObjectKeyStroke ( or layout ) script trigger, and have the triggered script set a stop flag and show a message that the script will be stopped when the current loop is finished.'

And then you could simply use the phrase "Press any key" or what ever key you desire, and the user will be notified of the result of his action right away.

Well maybe you could just use a OnObjectKeyStroke ( or layout ) script trigger, and have the triggered script set a stop flag and show a message that the script will be stopped when the current loop is finished.'

What makes you think the triggered script will run before the looping script has finished processing all records?

FMP sees modifier key presses even when it's running in the background: so of you ran a script, switched to Word then pressed CapsLock, FMP will see the modifier key and respond.

The test file demonstrates this.

test script.fp7.zip

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.