Adding printers via script
Due to great support i find my self here again asking more questions because i wanna learn how to write scripts 🙂
So bassically i work between 2 schools (all mac's) and each school has about 20 printers or so i would like to create a script so all i have to do when i want to add a printer is to enter is IP address of the printer, name and location. Im running into the problem after add printer has activated i cant seem to get it too click the ip bar up the top any feed back would be greatly appricated.
My script so far below
set Ip_address to ""
set printer_name to ""
set Location to ""
set dialog_1 to display dialog "Enter Printer Ip Adress" default answer "" buttons {"OK"} default button 1
set dialog_2 to display dialog "Enter Name of Printer" default answer "" buttons {"OK"} default button 1
set dialog_3 to display dialog "Enter Location of Printer" default answer "" buttons {"OK"} default button 1
set Ip_address to the text returned of dialog_1
set printer_name to the text returned of dialog_2
set Location to the text returned of dialog_3
tell application "AddPrinter" to activate
tell window "Printer Browser"
click button "IP Printer" of tool bar 1
set value of combo box 1 of group 1 of group 1 of group 2 of group 1 to "& Ip_address"
MacBook, Mac OS X (10.6.8)