I’ve created a few scripts for printing pages to postscript files and all work ok. As yet though I’ve not done any that ‘Export layout to pdf’. Please can someone point me in the right direction or to some info?
Is it a case of changing the print line:-
set thePSfile to (ps_folder & theName & ".p" & k & ".ps") as string
print page k of front document PostScript file thePSfile copies 1 OPI omit TIFF and EPS without print dialog
Don’t think it can be script the normal way.
This is a GUI way:
tell application "QuarkXPress"
activate
end tell
try
tell application "System Events"
tell process "QuarkXPress"
tell menu bar 1
tell menu bar item "File"
tell menu "File"
tell menu item "Export"
tell menu "Export"
click menu item "Layout as PDF..."
end tell
end tell
end tell
end tell
end tell
delay 1
tell window "Export as PDF"
click button "Save"
end tell
end tell
end tell
on error
display dialog "UI not working"
end try
Thanks for the reply and for the code which does exactly what is says on the tin!
I know this isn’t what I originally asked but I kinda wondered if there might be some way to amend the print statement so a pdf is generated instead of a postscript. The option appears in one of the print dialog boxes.
my understanding of “export layout as PDF” from quark is not recommended and it has been said that “quark openly admits that this should really only be used for proofing” I have not verified that yet. However, I had some code setup to do what pidge1 has supplied here and about 50% of that clients I sent them to had problems. Not only that when you export as a PDF quark gives font errors on some fonts which may or may not be corrupt and may or may not be replaced with courier. I have since changed my code to to make a PS file then us PSTOPDF to convert it this also results in a smaller file size.
Thanks for the reply and the suggestion. Looks like that’s going to be the best option.
Can’t say I’ve played around too much with scripting Distiller, can you recommend any good info (besides Macscripter that is ;)).
Thanks in advance,
Nick
EDIT: Sorry Mark, have just found another of your posts which is pretty nice.
take a look at the next post down. I’ve just posted some code that I’ve been using for some time its functual but not elegant but may give you some ideas to work in to your own process.
while I agree with Mark67 Distiller is expensive and the license agreement says that you can’t use it on a server unless you have licensees for the other machine in your company that are going to use the resulting PDF there by making it more expensive. PSTOPDF is a shell command that comes with the OS there is nothing to install.
In Quark 7 as usual some things has changed. I had a script that prints using Adobe PDF 7.0 then to a ps file to be run through Acrobat Distiller. This worked perfect until v7. Now if I use this method my final PDFBoxes such as the Trim, Bleed and Crop are not injected in the final PDF.
So now I’m changing my method of creating pdf’s from Quark & I’m trying to script GUI way using Export Layout as PDF… with the script posted in this section but Quark keeps defaulting to captured settings within the pdf styles dialog when running the script to export to pdf. I want to use my own defined pdf style but not sure how to do this. I already post this on Quark’s forums but I haven’t been succesfull & I hope I may get answer here. Any suggestions?
Thanks in advance,
AppleScript: 2.1.1
Browser: Safari 419.3
Operating System: Mac OS X (10.4)