Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Launching an application while executing an applescript?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Commander_FarkU" data-source="post: 1066242" data-attributes="member: 161638"><p>I'm very new to applescript, first day of trying to do anything. </p><p></p><p>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, </p><p>------------------------------------------------</p><p><span style="font-size: 9px">tell application "System Events"</span></p><p><span style="font-size: 9px"> if not UI elements enabled then</span></p><p><span style="font-size: 9px"> set UI elements enabled to true</span></p><p><span style="font-size: 9px"> end if</span></p><p><span style="font-size: 9px">end tell</span></p><p><span style="font-size: 9px"></span></p><p><span style="font-size: 9px">--Enable/Disable "Use all F1, F2, etc. keys as standard function keys" option in Keyboard & Mouse Preference pane and close System Preferences</span></p><p><span style="font-size: 9px">tell application "System Events"</span></p><p><span style="font-size: 9px"> tell application "System Preferences"</span></p><p><span style="font-size: 9px"> reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"</span></p><p><span style="font-size: 9px"> end tell</span></p><p><span style="font-size: 9px"> 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"</span></p><p><span style="font-size: 9px">end tell</span></p><p><span style="font-size: 9px">if application "System Preferences" is running then</span></p><p><span style="font-size: 9px"> tell application "System Preferences" to quit</span></p><p><span style="font-size: 9px">end if</span></p><p>------------------------------------------------</p><p>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.</p></blockquote><p></p>
[QUOTE="Commander_FarkU, post: 1066242, member: 161638"] 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, ------------------------------------------------ [SIZE="1"]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[/SIZE] ------------------------------------------------ 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. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Launching an application while executing an applescript?
Top