Here’s a doozy.
I’m working on a little script for our main production department to help batch print a group of Quark documents using the same print setup properties.
My thought was to just say something like “print using print style X”. But I don’t see any way of referring to print styles specifically. (Only getting a record of properties of “print setup”)
Well, I could hard-code each print style’s properties as a variable, but the list of print styles will grow in that department rapidly. Which would make my script invalid in a matter of days.
Would anyone have some kind of workaround? Or a suggestion on a different route? Here’s my current script. As it stands, I have tried to just open one document in advance, set THAT doc’s print style to the one I want for the rest, then I’m trying to set the properties of the FUTURE docs to the same print setup properties of the first doc. Not yet working. The two variables “theStyle” and “style_to_override” end up being the same. It currently ends with getting variable values and doesn’t get to the actual print action so it should be easy to toy with… just so you can see what I’m after… NOTE: I’m using Dialog Director here.
tell application "Desktop Printer Manager"
set printerList to name of every desktop printer
end tell
tell application "Finder"
set runProc to name of every process
if runProc does not contain "QuarkXPress" then
display dialog "Quark isn't running! Please launch Quark and retry." buttons {"Cancel"} default button 1 with icon 1
else
activate
set myFolder to (choose folder)
set myFiles to ((name of every file in folder myFolder) whose creator type is "XPR3")
set myDocs to ((every file in folder myFolder) whose creator type is "XPR3")
end if
end tell
set theDialog to {size:{218, 309}, style:standard palette, closeable:true, name:"mainWIndow ", default item:3, contents:{¬
{class:static text, bounds:{60, 24, 210, 54}, contents:"Choose Printer:", font:{name:"Geneva", size:10}}, ¬
{class:pop up, bounds:{59, 40, 209, 60}, value:1, contents:printerList}, ¬
{class:push button, bounds:{124, 272, 205, 292}, name:"Process"}, ¬
{class:static text, bounds:{4, 44, 54, 69}, contents:"Post Scripter", font:{name:"Geneva", size:10}}, ¬
{class:push button, bounds:{8, 272, 82, 292}, name:"Cancel"}, ¬
{class:icon, bounds:{4, 4, 36, 36}, contents:6002}, ¬
{class:list box, bounds:{8, 112, 208, 262}, value:0, contents:myFiles}, ¬
{class:pop up, bounds:{59, 84, 209, 104}, value:1, contents:{}}, ¬
{class:static text, bounds:{60, 68, 160, 84}, contents:"Choose Print Style:", font:{name:"Geneva", size:10}}}}
set dVals to dd auto dialog theDialog with fonts {name:"Charcoal", size:12} with grayscale
if item 3 of dVals then
set x to item 2 of dVals
set myPrinter to (item x of printerList)
tell application "Desktop Printer Manager"
set default printer to desktop printer myPrinter
end tell
tell application "QuarkXPress?"
tell document 1
set theStyle to properties of print setup
end tell
repeat with e in myDocs
open e
tell document 1
set style_to_override to properties of print setup
-- set style_to_override to theStyle
end tell
end repeat
end tell
end if