PostScript file via AS & the PostScript File for later disti

Discuss AppleScripting for QuarkXPress 10, 9 & 8 (and before)
macaria
Posts: 1
Joined: 11 Jul 2008, 09:23

PostScript file via AS & the PostScript File for later d

Post by macaria » 11 Jul 2008, 07:31

I'm new to this forum, to AS & hoping to get some help. I having odds results with PDF creation via PostScript file via AppleScript & PostScript file via export layout from Quark. All images in the Quark document are 300 dpi & I had configured a Distiller custom setting for PFDX1a Bicubic Downsampling at 300 dpi for images & a watched folder where both PostScript file created via Applescript & the PostScript File for later distilling are going to be saved & distilled. In the method PostScript File for later distilling featured by "Export Layout as PDF" all the options are setup with no compression at all because I want distiller to take care of that based on the PDFX1a settings. But when I preflight the pfd's to make sure they are OK to my surprise the one created via PS file via AS the images are 150 dpi & the other using PS File for later distilling the images are 300 dpi. How come? How both PostScript files are going to be different if they are saved & distilled in the same place? Please see below the script & feel free to advise me.
I found simliar post on this forum but Quarks suggestion doesn't apply to me because my distiller settings are set up to be Hi-Res
tell application "QuarkXPress"
activate
if not (exists (document 1)) then
display dialog "No document open, exit!" buttons {"OK"} default button "OK"
return
end if
tell document 1
set DocName to name as text
--set FilePath to "X-Files: PDF Stills: PDFX1a:In:" & DocName & ".ps"
set FilePath to "Leopard:Users:macaria:Desktop:test scripts:In:" & DocName & ".ps"
set pagewidth to page width as number
set pagewidth to (pagewidth + 1)
set pageheight to page height as number
set pageheight to (pageheight + 1)
end tell
tell print setup of document 1
set printer type to "AdobePDF 7.0"
set paper size to "Custom"
set paper width to pagewidth
set paper height to pageheight
set orientation to portrait
set page position to center horizontal
set print spreads to false
set reduce or enlarge to "100%"
set registration marks to centered
set registration marks offset to "12pt"
set print quality to normal
set data format to binary data
set bleed to ".125"
set output setup to "Composite CMYK"
set separation to false
set resolution to 2400
end tell
print document 1 PostScript file {FilePath}
end tell

trajesh
Posts: 1
Joined: 29 Jul 2008, 08:55

PostScript file via AS & the PostScript File for later disti

Post by trajesh » 29 Jul 2008, 03:06

Dear [strong]Macaria,[/strong]
Change the PDF Preferences to PS and Create PS file through Export> Layout as PDF and drop the PS to your watched folder.
It will output as per the PDF/X settings and the resolution will not change to 150dpi.
Thanks
Rajesh

macaria
Posts: 1
Joined: 11 Jul 2008, 09:23

PostScript file via AS & the PostScript File for later disti

Post by macaria » 04 Aug 2008, 02:52

Thank you Trajesh for your reply. After many tests I found the script.xtn was corrupted. I replaced with a new one and now PDF's have the correct resolution. However the PDF file size is 2 times and 1/2 bigger using the method Postscript via Applescript. I was pursing Postscript via Applescript because I would like to automate this task . The office I work for we started sending to the printer PDF's instead of Quark docs. It's easier and quicker to drag docs to a droplet but I'm having much better results with Postscript via Export Layout as PDF that definitely I'll use it.

Hansa Junchun
Posts: 0
Joined: 08 Nov 2012, 09:48

PostScript file via AS & the PostScript File for later disti

Post by Hansa Junchun » 15 Nov 2012, 09:32

Now that I'm done with find/changing in my 145,000 pages, its onward to printing as postscripts. Now, this script looks like something I would want to use to automate my postscripting tasks.
Question is: do I have to set so many parameters or does my default printer take care of everything, and I just script the path to save the files as postscripts?

Hansa Junchun
Posts: 0
Joined: 08 Nov 2012, 09:48

PostScript file via AS & the PostScript File for later disti

Post by Hansa Junchun » 16 Nov 2012, 03:25

Hello, I have simplified the above script and got it to work -- once. The PS looked good, too, after I distilled it. Here's what I used:
tell application "QuarkXPress"
activate
tell document 1
--set FilePath to "X-Files: PDF Stills: PDFX1a:In:" & DocName & ".ps"
set FilePath to "HJunchun-DT:HJunchun-HD:Users:hjunchun:Desktop:SXX:" & ".ps"
end tell
print document 1 PostScript file {"HJunchun-DT:HJunchun-HD:Users:hjunchun:Desktop:SXX:" & ".ps"}
end tell
But the question is, why once? Cant figure out what changed. I tried to test multiple docs and changed document 1 to documents of application QuarkXPress, and got error messages.
So I changed it back to the script above, which gave me no error message, but also no activity!
Any ideas, folks?

Emma
Posts: 657
Joined: 07 Jul 2004, 08:43

PostScript file via AS & the PostScript File for later disti

Post by Emma » 16 Nov 2012, 03:36

All the script between 'tell document'and 'end tell' doesn't actually do anything.
As for the rest, you haven't actually given your postscript file a name. I ran a slightly modified version quite successfully:
tell application "QuarkXPress"

print document 1 PostScript file {(path to desktop as text) & "TEST.ps"}

end tell

Hansa Junchun
Posts: 0
Joined: 08 Nov 2012, 09:48

PostScript file via AS & the PostScript File for later disti

Post by Hansa Junchun » 16 Nov 2012, 04:01

I'm sorry, I don't understand the syntax as yet. If this is the script,

tell application "QuarkXPress"
print document 1 PostScript file {(path to desktop as text) & "TEST.ps"}
end tell

what does "path to desktop as text" mean?
This is the path I used successfully once; that is, I ran a script and the PS appeared in the intended folder: "HJunchun-DT:HJunchun-HD:Users:hjunchun:Desktop:SXX:"
Why name it TEST.ps? When I ran it with just .ps, the name of the quark file was the name of the .ps, which is what I need.
Thanks, Emma!

Emma
Posts: 657
Joined: 07 Jul 2004, 08:43

PostScript file via AS & the PostScript File for later disti

Post by Emma » 16 Nov 2012, 04:13

Sorry, test was just a random word I put in.

If you just start an empty script, type in
path to desktop
and hit run, it generates the path to your desktop. It's easier than typing in all that long string!
Your script doesn't include the name of the Quark file at all, as far as I can see. Try this:
tell application "QuarkXPress"
print document 1 PostScript file {(path to desktop as text) & name of document 1 & ".ps"}
end tell

Hansa Junchun
Posts: 0
Joined: 08 Nov 2012, 09:48

PostScript file via AS & the PostScript File for later disti

Post by Hansa Junchun » 16 Nov 2012, 04:25

Hi Emma, okay, your script worked as shown. My path was extended by one unnecessary step. Here's the new version.
tell documents of application "QuarkXPress"
print document 1 PostScript file {("HJunchun-HD:Users:hjunchun:Desktop:SXX:") & name of document 1 & ".ps"}
close document 1
end tell

So this is good! And as usual, I wanted to automate this process as much as possible. Pluralizing the syntax (print documents, close documents) resulted in script errors.
However, I found on the MacSCripter site some useful syntax and incorporated it as thus:
tell application "QuarkXPress"
set t to count documents
repeat with i from 1 to t
print document 1 PostScript file {("
HJunchun-HD:Users:hjunchun:Desktop:SXX:") & name of document 1 & ".ps"}
close document 1
delay 1
end repeat
end tell

In the lines "set t to count documents / repeat with i from 1 to t" ... what is i and t?

Thank you!

Jean-Marie Schwartz
Posts: 1174
Joined: 23 Nov 2004, 04:30

PostScript file via AS & the PostScript File for later disti

Post by Jean-Marie Schwartz » 18 Nov 2012, 22:35

Hi! If I may pop in letter i is a variable used for the repeat loop. So at the 1st turn, it shall have 1 as a value; at the second turn, 2; etc. till the number of documents is hit (that is previously set as t, but actually is the number or count of documents).
Note that your script as is will only be usefull if you have a bunch of docs open in Quark at a time. So if you want it to process files you drop on a droplet, you'll want to slightly modify it in order to process each file in turn.

Post Reply

Return to “QuarkXPress 8, 9 & 10: AppleScript”