At my office we use Minolta network printers, which require a billing code input. I have some users who have to print multiple documents at a time and don’t like having to type in their billing code for every single document. I wanted to automate this process, but came across an error.
Basically, I have a pop up that asks the user their billing code, and I want that input to be copied into the field in the Print manager application. (a third party application called “Equitrac Login Controller”.
display dialog "Choose multiple files by holding Shift and selecting the first and last file you would like." with title "Select Files to Print"
set theFiles to choose file with multiple selections allowed
tell application "System Events"
display dialog "Enter Billing Code:" default answer ""
set theNumber to text returned of result
end tell
tell application "Finder"
print theFiles
end tell
tell application "System Events"
tell window "WINDOW NAME" of process "APPLICATION NAME"
set value of text field 1 to theNumber
click button "OK" of group 2
end tell
end tell
The error that comes up is:
"Can’t set window “WINDOW NAME” of <> “APPLICATION NAME” of application “System Events” to “####”
Any suggestions?