laugh at my newbieness while helping me...

I’m trying to come up with a simple script that opens the “Activation” tab of the the “Screen Effects” item within the “System Preferences” application…

I get as far as

tell application “System Preferences” to activate

Then I’m stuck.

I change from password protected screen effects to non-password-protected quite often (one at work, the other at home) and would like a script to make this easier–I’d like to have a script that would let me easily toggle between protected and unprotected, but I’m having trouble getting there.

help?

Assuming that you have installed Apple’s UI Scripting software, this might work.

tell application "System Preferences" to activate
set exists_ to false

tell application "System Events"
	tell application process "System Preferences"
		tell menu item "Screen Effects" of menu "View" of menu bar 1 to click
		repeat until exists_ is true
			set exists_ to exists window "Screen Effects"
			delay 1
		end repeat
		tell radio button "Activation" of tab group 1 of window "Screen Effects" to click
	end tell
end tell

It could probably stand some error checking but this should get you started.

– Rob