I’m developing an app that will perform an automatic function on launch unless the option key is held down. If so, the preferences window will appear, letting the user set the defaults for the automatic launching.
I can’t figure out how to catch the option key down event even though the docs say it is possible during application events. I am trying this in the on on Launched application event like this:
on launched theObject
if option key down of event then
load nib "Preferences"
set preferencesWindow to window "preferences"
loadPreferences(preferencesWindow)
set visible of preferencesWindow to true
else
runProcess(theDuration, theRepetition)
end if
end launched
Of course, this gives an error.
Is it possible to do this?
Thanks.