I have put together a script to change my default Printer. I found it here but when I ran it the List wouldn’t be the activated application so I added a “System events” to allow me to use the keyboard to select the printer. Here is my script I hobbled together:
tell application "Printer Setup Utility"
set printerlist to name of every printer
end tell
tell application "System Events"
activate
choose from list printerlist with prompt "Choose which Printer:"
end tell
set thePrinter to item 1 of result
tell application "Printer Setup Utility"
set current printer to first printer whose name is thePrinter
end tell
So now when I run the script I can select the printer with the keyboard but after the script finishes I need to apple+tab out and back into the application I was in in order to continue working on it. Does anyone know how to get the application I was working in (not always the same) to activate again?
Thanks,
Brad
Model: Macbook 2.66 i7, SSD
AppleScript: 2.1.2
Browser: Safari 534.30
Operating System: Mac OS X (10.6)