Help with script to remove printer

Joined
Jul 16, 2018
Messages
1
Reaction score
0
Points
1
Screen Shot 2018-07-17 at 1.13.27 pm.png

I just want to be able to press the "Delete Printer" button with a script.

This is what I have so far -

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

delay 2

tell application "System Events"
tell process "System Preferences"

click button 2 of window "Printers & Scanners"
return
end tell
end tell

delay 2

tell application "System Events"
tell process "System Preferences"
delay 1
tell sheet 1 of window "Printers & Scanners"
click "Delete Printer"
end tell

end tell
end tell

What am I missing?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top