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
Applescript Snow Leopard to Lion
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="mtmanner" data-source="post: 1367826" data-attributes="member: 237375"><p>I have a script that was working fine in Snow Leopard. Can't figure out why it isn't functioning in Lion.</p><p></p><p>Thoughts?</p><p></p><p>Here's the script -- designed to toggle the "tap to click" box on the trackpad (using an MBA2011: 10.7.2)</p><p></p><p>-- want it on or off?</p><p>display dialog "Turn trackpad-clicking on or off?" buttons {"Cancel", "Turn Off", "Turn On"} default button 3 with icon note</p><p>if (button returned of result) is "Turn On" then</p><p> set theValue to 1</p><p>else</p><p> set theValue to 0</p><p>end if</p><p></p><p>-- open the preference pane</p><p>tell application "System Preferences"</p><p> activate</p><p> reveal (pane id "com.apple.preference.trackpad")</p><p>end tell</p><p></p><p>tell application "System Events"</p><p> tell process "System Preferences"</p><p> -- check the current value of the checkbox and change it if needed</p><p> tell checkbox "Clicking" of group 1 of window 1</p><p> repeat until exists (* wait until the object is accessible *)</p><p> delay 0.2</p><p> end repeat</p><p> if value is not theValue then click</p><p> end tell</p><p> </p><p> -- leave the trackpad preference pane</p><p> click button "Show All" of group 1 of group 2 of tool bar 1 of window 1</p><p> </p><p> -- hide system preferences</p><p> set visible to false</p><p> end tell</p><p>end tell</p></blockquote><p></p>
[QUOTE="mtmanner, post: 1367826, member: 237375"] I have a script that was working fine in Snow Leopard. Can't figure out why it isn't functioning in Lion. Thoughts? Here's the script -- designed to toggle the "tap to click" box on the trackpad (using an MBA2011: 10.7.2) -- want it on or off? display dialog "Turn trackpad-clicking on or off?" buttons {"Cancel", "Turn Off", "Turn On"} default button 3 with icon note if (button returned of result) is "Turn On" then set theValue to 1 else set theValue to 0 end if -- open the preference pane tell application "System Preferences" activate reveal (pane id "com.apple.preference.trackpad") end tell tell application "System Events" tell process "System Preferences" -- check the current value of the checkbox and change it if needed tell checkbox "Clicking" of group 1 of window 1 repeat until exists (* wait until the object is accessible *) delay 0.2 end repeat if value is not theValue then click end tell -- leave the trackpad preference pane click button "Show All" of group 1 of group 2 of tool bar 1 of window 1 -- hide system preferences set visible to false end tell end tell [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Applescript Snow Leopard to Lion
Top