Scripting Quicktime Preferencesq

I’m trying to script enabling flash in the Quicktime Pane of the System Preferences. I’m getting close, but no cigar.

This is what I got so far:


tell application "System Preferences"
	activate
	set current pane to pane "QuickTime"
end tell


tell application "System Events"
	tell application process "System Preferences"
		tell tab group 5 of window "QuickTime"
			click checkbox "Enable Flash"
		end tell
	end tell
end tell


It errors out on “Enable Flash.” but I’m not necessarily sure that that is exactly where the problem in my syntax begins. Does Anyone have any suggestions?

Also, I guessed the positions of the checkbox because this setting is on the 5 tab from the left. Is that the way to reference the object?

Thanks

Steve

PS: Running script in Tiger

Hi Wexie

Try this.

tell application "System Preferences"
	activate
	set current pane to pane "QuickTime"
end tell


tell application "System Events"
	tell application process "System Preferences"
		--get properties of UI elements of tab group of window "QuickTime"
		click radio button "Advanced" of tab group of window "QuickTime"
		click checkbox "Enable Flash" of tab group of window "QuickTime"
	end tell
end tell

Thanks pidge1

When I run that script, I still get the error:

According to Script Editor, it is this line that triggers the error:


click radio button "Advanced" of tab group of window "QuickTime"

I also tried this and got the same error:


click checkbox "Enable Flash" of tab group "Advanced" of window "QuickTime"

Hi Wexie

Just tried it again and it works fine! Here…
Are you sure you have Gui scripting switched on properly…

If any one else is reading this post would someone kindly test this script to see if
it functions on there machine ok…

tell application "System Preferences"
   activate
   set current pane to pane "QuickTime"
end tell


tell application "System Events"
   tell application process "System Preferences"
       --get properties of UI elements of tab group of window "QuickTime"
       click radio button "Advanced" of tab group of window "QuickTime"
       click checkbox "Enable Flash" of tab group of window "QuickTime"
   end tell
end tell

Wexie

It may be just a difference in the way our macs are configured… lets see if
anyone else can get it to work…

Thanks jacques

if mine still doesn’t work for you wexie then jacques should do the trick…

Oops. My Bad. My GUI scripting was not activated. Sorry about that, I forgot to set that when I got my new laptop.

If I am sending this script out over a network to run via ARD, is there a line I can add to make sure the clients system has the GUI setting on?