Re: Printing an AW document to PDF Services
Re: Printing an AW document to PDF Services
- Subject: Re: Printing an AW document to PDF Services
- From: Hugo Benitez <email@hidden>
- Date: Tue, 29 Jul 2003 13:48:55 -0500
Hi,
In the past there have been some requests on printing PDF documents by
using GUI. Kok Ooi Kong has provided excellent solutions to print a
document to a PDF file.
But, it is possible to do more than a PDF file when printing a
document, ie: fax it (with Cocoa eFax), send by mail, create and PDF
document and compress it (PdfCompress), stuff it, zip it, and the like.
All of these by using PDF Services.
I personally use AppleWorks for my work and I prefer producing PDF
documents to be sent by email, that is why I have been searching on
printing (mainly) these documents. I have written a script to select
an action to :produce a PDF document, fax it, email it or whatever, ask
AW to print it to the selected action, via PDF Services. Currently it
only looks for PDF Services installed in the current user PDF Services
folder.
property theList : {}
property theLista : {}
property indx : ""
tell application "Finder"
activate
set theFolder to folder "PDF Services" of folder "Library" of home as
alias
set theLista to the name of every file in folder theFolder
set theList to "Save as PDF..." as list
set i to 1
set cont to (count items in theLista)
repeat cont times
set theList to theList & item i in theLista as list
set i to i + 1
end repeat
set theResult to choose from list theList with prompt "Select the
action with PDF file"
if the result is not false then
set i to 1
repeat cont + 1 times
set loc to offset of theResult in (item i of theList)
if loc = 1 then
set indx to i
exit repeat
else
set i to i + 1
end if
end repeat
end if
end tell
delay 1
tell application "AppleWorks 6"
activate
end tell
delay 1
tell application "System Events"
click menu item "Print" of menu "File" of menu bar 1 of application
process "AppleWorks 6"
delay 3 -- may be this value must be changed according to the time it
takes the Print window to open
tell window "Print" of application process "AppleWorks 6"
click menu button 1 of UI element 6
repeat indx times
keystroke (ASCII character 31)
end repeat
keystroke return
end tell
end tell
Possibly (or surely) there will be a better way to accomplish this,
but, so far, it has been useful for me. I hope somebody of the people
that have been asking for PDF printing find this useful also.
Regards,
Hugo
PS with slight modifications it is also possible to use this script for
Word, Mail, and other applications.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.