I am trying to write a script to change the default printer, so I can attach it to a Network Location switch in Keyboard Masetro. I cannot work out how to change the printer in the ‘Default printer’ dropdown menu. Here is what I have so far:
tell application “System Preferences”
activate
end tell
tell application “System Events”
tell process “System Preferences”
click menu item “Printers & Scanners” of menu “View” of menu bar 1
delay 2
tell application “System Events”
– not sure what to put here. The desired printer name is “Xerox Phaser 3160”
end tell
end tell
end tell
Model: MacBook Pro 13" 2016
AppleScript: 2.7
Browser: Safari 15608.3.10.1.4
Operating System: macOS 10.14