Skip 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.

How to? different scripts from same button?

Featured Replies

  • Newbies

Hi all,

Sorry if this has been asked 50 times already, but a quick search didn't help.

I would like to have a button on a layout that when shift clicked will run one script, and when option clicked will run a different script.

This seems like a common thing to want to do, but I can't figure it out. Is it possible or do you have to resort to something like apple script or something?

I am using FM6 in a Mac environment.

Thanks,

Mark

If [ Status(CurrentModifierKey) = 1 or Status(CurrentModifierKey) = 3 ]

#Shift (or Shift + CapsLock) key pressed.

<perform stuff here>

Else

<Perform other stuff here>

End If

You can run different branches of the same script:

If [ Mod ( Status(CurrentModifierKeys) , 2) ]

# Do something

Else

# Do something else

End If

To split the actions into separate scripts:

If [ Mod ( Status(CurrentModifierKeys) , 2) ]

Perform Script [ "some script"]

Else

Perform Script [ "another script"]

End If

I see Vaughan has provided a similar answer, but there is a difference:

Mod ( Status(CurrentModifierKeys) , 2)

will return true when Shift is pressed, irregardless of any other modifier key. So if the user is pressing Shift+Control, or Shift+Command, or any other combination, as long as the Shift key is one of the active modifier keys, the Shift key will be recognized.

Mod ( Status(CurrentModifierKeys) , 2)

Cool.

  • Author
  • Newbies

Thanks very much to both of you!

It all seems so simple now.

Thanks for pointing out the bit with the Mod

Mark

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.