Re: Print-to-PDF
Re: Print-to-PDF
- Subject: Re: Print-to-PDF
- From: Peter Baxter <email@hidden>
- Date: Sat, 10 Nov 2007 07:25:01 +1100
Hi Tim,
How about adapting this one to your purposes:
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 1
--
tell application "Preview" to activate
tell application "System Events"
tell application process "Preview"
click menu item "Print…" of menu 1 of menu bar item "File" of menu
bar 1
delay 0.5
click at position of UI element 1 of UI element 6 of UI element 4 of
sheet 1 of window 1
delay 0.2
-- key the down arrow and space bar to select the first item in the
"PDF" menu ("Save as PDF…"), and wait for the Save dialog to appear.
key code {125, 49}
delay 1
-- if new file name is needed, enter the pdf name into the Save
dialog's text field
set value of text field 1 of window 1 to "name_of _your_file.pdf"
delay 0.5
-- use Control-d to set the desktop as the destination
keystroke "d" using command down
delay 0.5
click button "Save" of window "Save"
delay 0.2
end tell
end tell
"For every complex problem, there is a solution
that is simple, neat and wrong." -H.L.Mencken
Peter Baxter
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden