I have been racking my head to figure this out. Below is my script that should add a printer, however when I first run the script it gets caught up on a text field, if i run the script a second time with the Add Printer window open it works!
-- Set printers via ARD from AppleScript
tell application "AddPrinter" to activate
tell application "System Events" to tell process "AddPrinter"
set address to "18.104.22.168" -- printer ip address variable
set printername to "Some Laser Printer" -- Printer name varaible
set printerlocation to "Some Lab" -- Printer Location
-- Set Protocol:
tell group 1 of window "Add Printer"
tell group 2
click pop up button 1
click menu item "Internet Printing Protocol - IPP" of menu 1 of pop up button 1
click combo box 2
keystroke (address) -- sets ip address from address variable
keystroke (printername) -- sets printer name
keystroke (printerlocation) -- sets location of printer
-- Add Printer
tell window "Add Printer"
click button "add"
tell sheet 1 of window "Add Printer"
tell group 1 of group 1
click button "Continue"
thanks in advance.
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription: