gui scripting & SETI
gui scripting & SETI
- Subject: gui scripting & SETI
- From: Matt Riley <email@hidden>
- Date: Fri, 03 Jan 2003 17:00:21 -0600
I decided to try my hand at the new GUI scripting capability to workaround a
little problem I have. I manage a few computers on our network and I run
SETI on all of them so that I don't feel like the cycles are going to waste.
That and I like the distributed computing idea/cause. ;-)
One of the users likes to go in and turn the screensaver off. I can't
prevent the user from doing this by blocking access to the app since I have
gathered that it needs to be launchable from his account to work in the
first place. If I block access to the app, it gives an error when it
launches and stops.
I thought that I could write an applescript that would run at a specific
time (when he is not at work) that opens up the prefs of SETI, checks the
box to turn the screensaver back on, allowing the screensaver to go about
its business. Here is what I have so far:
tell application "SETI@home_OSX"
activate
end tell
tell application "System Events"
tell process "SETI@home_OSX"
click menu item "Preferences
" of menu "SETI@home_OSX" of menu bar 1
delay 2
tell window "SETI@home Preferences"
if the value of check box 2 is 0 then
click check box 2 -- enable screensaver
end if
end tell
end tell
end tell
I adapted bits and pieces from the Finder prefs script on Apple's site. I
can get that one to work just fine. However, my SETI adaptation of the
script doesn't quite work - but it is really close.
When I run the script, it launches SETI, opens the prefs window and then I
can actually see it "click" the Enable Screensaver button but the checkbox
doesn't actually change state (i.e. it clicks it, but it never gets a
checkmark).
Any ideas? (OS X 10.2.3, SETI@home_OSX 3.0.7)
-Matt
PS--The result window of Script Editor (the 2.0 beta) looks like this when I
run the script:
check box "Enable Screensaver" of window "SETI@home Preferences" of
application process "SETI@home_OSX" of application "System Events"
It says essentially the same thing when I run the script for the Finder
prefs, so nothing looks out of place to me. I don't get it...
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.