Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Help with script to remove printer
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="youreckonbut" data-source="post: 1796223" data-attributes="member: 399789"><p>[ATTACH=full]28309[/ATTACH]</p><p></p><p>I just want to be able to press the "Delete Printer" button with a script.</p><p></p><p>This is what I have so far -</p><p></p><p>tell application "System Preferences"</p><p> activate</p><p> set current pane to pane id "com.apple.preference.printfax"</p><p>end tell</p><p></p><p>delay 2</p><p></p><p>tell application "System Events"</p><p> tell process "System Preferences"</p><p> </p><p> click button 2 of window "Printers & Scanners"</p><p> return</p><p> end tell</p><p>end tell</p><p></p><p>delay 2</p><p></p><p>tell application "System Events"</p><p> tell process "System Preferences"</p><p> delay 1</p><p> tell sheet 1 of window "Printers & Scanners"</p><p> click "Delete Printer"</p><p> end tell</p><p> </p><p> end tell</p><p>end tell</p><p></p><p>What am I missing?</p></blockquote><p></p>
[QUOTE="youreckonbut, post: 1796223, member: 399789"] [ATTACH=FULL]28309[/ATTACH] 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? [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Help with script to remove printer
Top