Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Print Word document to PDF



Thanks Michael,

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



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Print word document to PDF (From: Peter Baxter <email@hidden>)
 >Re: Print word document to PDF (From: Jeremy Sellors <email@hidden>)
 >Re: Print Word document to PDF (From: Michael Ghilissen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.