Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Applescript UI Scripting troubles...

Applescript UI Scripting troubles...
Thread Tools
Professional Poster
Join Date: Oct 2002
Location: Off the Tobakoff
Status: Offline
Reply With Quote
Jan 14, 2003, 09:14 PM
 
I wrote this script to change my monitor display sleep:

tell application "System Preferences"
activate
end tell
tell application "System Events"
get properties
tell process "System Preferences"
click menu item "Energy Saver" of menu "View" of menu bar 1
delay 2
tell slider 2 of tab group 1 of group 1 of window 1
if value is 541 then
set value to 1
else
set value to 541
end if
end tell
end tell
end tell
tell application "System Preferences"
quit
end tell

The problem is, while the slider is moved, it's as though the mouse is still held down on the slider, never lets up, therefore the value never switches (remove the quit part and realize that the "1 hour" or "1 minute" continue to display after it's set) can anyone help me figure out how to make this stick?
(Last edited by Stradlater; Jan 15, 2003 at 12:48 AM. )
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:03 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2