Check if checkboxes are checked or not

Is there a way to check to see if a checkbox is checked or not and if it isn’t, then have it check / uncheck it? Right now I am trying to run a script in Leopard (for Leopard only) to do a bunch of things in the System Preferences. For example, I want to be able to see if the Magnification checkbox is checked or not. If it isn’t, then I want to check it and set the slider all the way to the right. I also want to be able to set the slider for the dock size to be right in the middle. Here is all of the code that I have so far…

tell application "System Preferences"
	activate
	set the current pane to pane id "com.apple.preference.dock"
end tell

Sorry that I don’t have much, but I am brand new at this (only had my mac for 2 weeks) and I am really interested in learning this scripting language. Thanks in advance for any help at all!

Model: Intel Macbook 2.4 GHz, 4GB RAM, 160GB HDD
Browser: Firefox 3.0.5
Operating System: Mac OS X (10.5)

Hi,

welcome to MacScripter.

In Leopard the dock preferences are scriptable via System Events


tell application "System Events"
	tell dock preferences
		if magnification is false then set magnification to true
		set magnification size to 1.0
		set dock size to 0.5
	end tell
end tell

Thank you so very much! That is amazing. I am going to try it out now. :smiley: