Postscript from Quark
Postscript from Quark
- Subject: Postscript from Quark
- From: Duncan Cowan <email@hidden>
- Date: Sat, 13 Jul 2002 10:37:51 +1000
I am seeking help with an annoying problem, can anyone tell me where I went
wrong?
Here are the details.
My brother wrote an applescript application that the company we work for is
very dependant upon.
Now he has run off to work for a massive multinational and has left me
holding the bag.
But, I can't write code. I can't even read it.
So working off snippets of his code and by searching through mailing list
archives like this one (praise be to the ghosts of applescript past)
I have managed to Frankenstein together this tiny amendment to a much larger
script.
It gets Quark to print a postscript file to a required location, moves that
file to a hot folder for processing, then prints a hard copy for proofing.
"my saveFolder" and "my clientDocTitle" are all passed from a text document.
It seams to work well - except for the occasional postscript error when the
"my clientDocTitle" doesn't have a number in the string. ( I think)
The actual problem is:
When I restart after a crash or whatever - the postscript file gets printed
to the desktop folder unless I open the script and re-compile it.
If I set the destination of the desktop printer to anything other than the
desktop when I build it (using the desktop printer utility) then the file is
sent to that destination regardless.
on print_document_ps() --
-- Set Virtual Postscript Printer
tell application "Desktop Printer Manager"
set default printer to desktop printer the "Virtual Printer"
end tell
--Print Postscript File
tell application "QuarkXPress 4.1"
activate
set print setup of document 1 to {printer type:"Barco Graphics
TransScript OF", resolution:1200, data format:binary data, halftone
screen:"150"}
print document 1 PostScript file (my saveFolder & my
clientDocTitle & ".ps" as text)
end tell
-- Copy PS to (Hot folder) on Server
if my fileFormat = "EPS" then
tell application "Finder"
activate
if exists (file (my clientDocTitle & ".ps" as string) of
folder (my saveFolder as string)) then -- catch slow PS processing
copyFile (my saveFolder & my clientDocTitle & ".ps" as
text) to (alias "input_ps:") with replacing
else
delay 5 -- catch slow PS processing again
copyFile (my saveFolder & my clientDocTitle & ".ps" as
text) to (alias "input_ps:") with replacing
end if
end tell
end if
-- Reset Hardcopy Printer
tell application "Desktop Printer Manager"
set default printer to desktop printer the "Real Printer"
end tell
-- Make Quark Active to complete "on clean_Up"
tell application "QuarkXPress 4.1"
activate
end tell
end print_document_ps
Sorry to be long winded - but I'm not sure what parts might be relevant.
Thanks in advance
Duncan
PS. remember to speak very, very slowly - I'm a graphic designer.
_______________________________________________
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.