Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7105 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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

Posted

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

#Shift (or Shift + CapsLock) key pressed.

<perform stuff here>

Else

<Perform other stuff here>

End If

Posted

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

Posted

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.

Posted

Mod ( Status(CurrentModifierKeys) , 2)

Cool.

  • Newbies
Posted

Thanks very much to both of you!

It all seems so simple now.

Thanks for pointing out the bit with the Mod

Mark

This topic is 7105 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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