How to put text into text box??

Hi all,

I am trying to Applescript Printer Setup Utility to install an LPR printer. How can I get to the “Name” box in the Printer Setup Utility and enter text? It doesnt let me send tab keystrokes to get to it. HELP PLEASE! :slight_smile:


tell application "Printer Setup Utility" to activate
tell application "System Events"
	tell application process "Printer Setup Utility"
		set frontmost to true
		click menu item "Add Printer." of menu 1 of menu bar item "Printers" of menu bar 1
		tell window "Printer Browser"
			delay 5
			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 "print-server"
			delay 1
			set value of combo box 2 of group 1 of group 1 of group 2 of group 1 to "queue-name"
			delay 1
			click button "Add"
		end tell
	end tell
end tell
tell application "Printer Setup Utility" to quit

This seems to get it done


tell application "Printer Setup Utility" to activate
tell application "System Events"
	tell application process "Printer Setup Utility"
		set frontmost to true
		click menu item "Add Printer." of menu 1 of menu bar item "Printers" of menu bar 1
		tell window "Printer Browser"
			delay 5
			click button "IP Printer" of tool bar 1
			keystroke tab & tab & tab
			delay 1
			keystroke "print-server" & tab & "queueName"
			--click button "Add"
		end tell
	end tell
end tell
--tell application "Printer Setup Utility" to quit

Thanks for the reply. I tried it and it doesn’t enter anything into the boxes. The tabs don’t seem to tab through the boxes…Any ideas?

I’m running a very fast machine so the delays may not be adequate.

As a test, run this much of the script (below) and then click on the Printer Setup Utility icon in your dock, but don’t do anything else. When you’ve got the PSU’s Printer Browser in front, it should be on the IP printer pane. Now, tab with the tab key and see if three tabs highlight the first text box, type some characters and they should go there. If so, then tab once more and you should be in the second text box. Type some characters and they should go there. If that works, then it’s all about timing.

If it doesn’t work, I’m running OS X 10.4.7, PSU version 4.6 on a G5. What are you running? I have “Enable access for assistive devices” checked at the bottom of the “Universal Access” preference pane. Do you?


tell application "Printer Setup Utility" to activate
tell application "System Events"
	tell application process "Printer Setup Utility"
		set frontmost to true
		click menu item "Add Printer." of menu 1 of menu bar item "Printers" of menu bar 1
		tell window "Printer Browser"
			delay 5
			click button "IP Printer" of tool bar 1 -- it stops here for the rest of the test.
			(*keystroke tab & tab & tab
			delay 1
			keystroke "print-server" & tab & "queueName"
			click button "Add"*)
		end tell
	end tell
end tell
--tell application "Printer Setup Utility" to quit