Hello All
after quite a while trying to identify the UI elements of Print in Word 2004 I need help to use the “Save to PDF” function inside applescript.
I want to be able to select a word doc file and to get a copy of the same file in pdf format in the same location. Does anybody know how to script “Save to PDF” with Word 2004 ?
below what I try so far
“quote”
tell application “Finder”
set fileName to (choose file “Choose File to convert!”)
open fileName
end tell
delay 5
tell application “System Events”
get properties
tell process “Microsoft Word”
get every UI element
tell menu 1 of menu bar item 3 of menu bar 1
click menu item 16
delay 2
end tell
end tell
tell sheet “Print” of window 1
tell UI element 3 – THE UI ELEMENT ID IS WRONG
click menu button 0
tell menu button 0
click menu item 1 or menu 0
end tell
end tell
end tell
end tell
“unquote”
as the ui element number is wrong I got the "NSReceiverEvaluationScriptError: 4 " error.
any idea or does anybody can identify the UI element NUMBER in the
“Print” window for “Save to PDF” and thereafter in the “Save to File” window for “Save” ?
thx for all help
linus