G’day
I’m trying to automate the printing of excel documents. I can use 10 tabs to get to the last page range box, but would prefer to do it more directly.
I’ve use UI browser to find the details of the appropriate text box, but the three methods I’ve tried to set it have failed.
Can anyone set me straight on any mistakes I’ve made please?
tell application "Microsoft Excel"
activate
repeat until exists window 1
delay 0.5
end repeat
tell application "System Events" to tell process "Microsoft Excel"
keystroke "p" using command down
delay 4
tell application "System Events" to tell process "Microsoft Excel" to tell window 1
set value of text field 3 of UI element 1 of UI element 6 to 3
select text field 3 of UI element 1 of UI element 6
keystroke 3
end tell
tell window 1
set value of text field 3 of UI element 1 of UI element 6 to 3
--keystroke return
end tell
delay 2
keystroke "w" using command down
end tell
end tell