Launching an application while executing an applescript?

Joined
Jun 13, 2010
Messages
1
Reaction score
0
Points
1
I'm very new to applescript, first day of trying to do anything.

What I am trying to do is, when a game starts up I want it to run a script that will change my function keys to standard function keys. I have a script for it,
------------------------------------------------
tell application "System Events"
if not UI elements enabled then
set UI elements enabled to true
end if
end tell

--Enable/Disable "Use all F1, F2, etc. keys as standard function keys" option in Keyboard & Mouse Preference pane and close System Preferences
tell application "System Events"
tell application "System Preferences"
reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"
end tell
click checkbox "Use all F1, F2, etc. keys as standard function keys" of tab group 1 of window "Keyboard & Mouse" of application process "System Preferences"
end tell
if application "System Preferences" is running then
tell application "System Preferences" to quit
end if

------------------------------------------------
but I can't figure out how to get it to run when the application starts. Is this even possible? I would appreciate any help.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top