UI Scripting System Preferences

I am very new to applescript, so bare with me. I am trying to script Printer Sharing so I can toggle on/off. I came across the UI Inspector and have had some sucess. I keep getting an error “System Events got an error: NSReceiverEvaluationScriptError: 4”. The error comes up with "Click checkbox “Printer Sharing” " Highlighted. Any help would be great.


tell application "System Preferences"
	activate
end tell
tell application "System Events"
	tell process "System Preferences"
		tell window "System Preferences"
			tell scroll area 1
				click button "Sharing"
				tell window "Sharing"
					tell tab group 1
						tell scroll area 1
							tell table 1
								tell column 1
									tell row 1
										click checkbox "Printer Sharing"
									end tell
								end tell
							end tell
						end tell
					end tell
				end tell
			end tell
		end tell
	end tell
end tell

Thanks for the reply Jacques. But still no luck. I tried both of the scripts you posted with the same results(System Events got an error: NSReceiverEvaluationScriptError: 4). The error seems to be on:

click item 1 of (checkbox of rows of table 1 of scroll area 1 of tab group 1 whose value of static text 1 is “Printer Sharing”)

Any other thoughts?