Re: GUIscritpting, Pages and PDF
Re: GUIscritpting, Pages and PDF
- Subject: Re: GUIscritpting, Pages and PDF
- From: KOENIG Yvan <email@hidden>
- Date: Tue, 29 Jan 2008 19:05:28 +0100
Le 25 janv. 2008 à 06:26, CYB a écrit :
Yvan, whwy not use this
-- AppleScript
tell application "Printer Setup Utility"
set current printer to printer "CUPS-PDF"
end tell
tell application "Pages"
tell document 1
print
end tell
end tell
-- end of AppleScript
The only thing you need is to install the free app printer "CUPS-PDF"
This application is a virtual printer that in an efficient way "print"
anything to PDF is an open source, the linl to download is
http://www.macupdate.com/info.php/id/20219
I hope this help
Salute
Back to my problems with Pages and PDF.
i installed the CUPS-PDF driver.
It appears in the Print Dialog as "Virtual printer"
I'm trying to use it to print each page of a document in a single file.
I know that I will have to rename the PDF because the driver will use
the same name for every page.
reduced to a minimal one the script is:
(* the file myFile.pages is open *)
set p to 3
tell application "Printer Setup Utility"
set oldPrinter to name of current printer
set current printer to printer "Virtual Printer"
end tell
tell application "Pages"
activate
set pd1 to (path of document 1) (* gives an UNIX path *)
set pd1 to pd1 as POSIX file (* switch to HFS path *)
print pd1 with properties {starting page:p, ending page:p}
end tell
tell application "Printer Setup Utility" to set current printer to
printer oldPrinter
At this time I met two problems.
a -- it doesn't print only the page 3 but the 6 pages of the document.
b -- the PDF file appears as myFile.pdf on the Desktop while
when done "by hand" I get a file named _myFile_.pdf in a folder
named "cups-pdf" on the desktop.
Help welcome.
Yvan KOENIG _______________________________________________
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