Your script helped me get through the problem of not being able to get to Preview. Here is the resulting script. I'll refine it from here.
That 13 second delay should be able to be checked against activity in system events using a loop.
set myfile to "test" as text
tell application "Microsoft Word" to activate
tell application "System Events"
tell application process "Microsoft Word"
click menu item "Print..." of menu "File" of menu bar item "File" of menu bar 1
delay 0.5
click button 4 of UI element 5 of window 1
end tell
end tell
--
delay 13
--
tell application "Preview" to activate
tell application "System Events"
tell application process "Preview"
keystroke "S" using command down
delay 3
tell application "System Events"
keystroke myfile
delay 0.2
key code 36
end tell
delay 4
keystroke "w" using command down
end tell
end tell
On 16/06/2007, at 9:29 PM, Michael Ghilissen wrote:
Here is my version of a Word to PDF script:
Outside of a dog, a book is a man's best friend. Inside a dog, it's too dark to read. - Groucho Marx
Peter Baxter