From other posts I learned how to detect modifier keys. For now, I use rdelmar’s simple way to quit my application from the menu with or without a confirmation dialog, depending on the Alt-key being pressed when I choose the menu item:
on stopErmee_(sender) -- triggered from menu item
set modKey to NSEvent's modifierFlags()
if modKey =2^19 then tell current application to quit
set theAnswer to button returned of (display dialog "Stoppen?" buttons {"Ja", "Nee"} with title "Muse" with icon caution)
if theAnswer is "Ja" then tell current application to quit
end stopErmee_
This works ok, but now I would like the menu text to change upon pressing Alt. Like it does in Real Programs! How do I go about that? (The menu is the only UI, the app is entirely controlled from a menulet).
Model: iMac
AppleScript: Xcode 4.5
Browser: Safari 536.25
Operating System: Mac OS X (10.8)