Le 5 oct. 2006 à 00:07, Bill Cheeseman a écrit :
10.4.8/Intel
I restarted with no ~/Library/ScriptingAdditions just to make sure. It still works. I concocted the script with Bill's goal but not his code. I didn't know the value indicator had its containing slider as a supervisor so I added a 'select' command in case I had to change the focus for it to have values. But that turned out to be unnecessary.
tell application "System Preferences" activate set current pane to pane id "com.apple.preference.desktopscreeneffect" end tell tell application "System Events" to tell application process "System Preferences" tell window 1 tell tab group 1 click radio button "Screen Saver" tell group 1 tell slider 1 select value indicator 1 set value to 361.0 end tell end tell end tell end tell end tell
Hello As this script failed on my G5 under Mac OS X 10.4.8, I tried to get the UI elements available when it tried to click.
Here is the result:
-- the Script:
tell application "System Preferences" activate set current pane to pane id "com.apple.preference.desktopscreeneffect" end tell tell application "System Events" to tell application process "System Preferences" tell window 1 tell tab group 1 get properties of every UI element return click radio button "Screen Saver" tell group 1 tell slider 1 select value indicator 1 set value to 361.0 end tell end tell end tell end tell end tell
-- the log report:
tell application "System Preferences" activate current application activate set current pane to pane id "com.apple.preference.desktopscreeneffect" end tell tell application "System Events" get properties of every UI element of tab group 1 of window 1 of application process "System Preferences" "Erreur dans System Events : NSReceiverEvaluationScriptError: 4"
Yvan KOENIG |