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