I'm trying to print single pages from a multi page Quark project and am finding that despite explicitly specifying which pages I want to print, the resulting PDFs have multiple pages.
Note that the PDFs are not a result of the Quark "Print to PDF", they are created by an independent back end process that monitors the print spooler and converts the spooled files to a PDF. This process has worked flawlessly for years, so I don't think it is doing anything wrong I think the problem is in my script.
What I'm seeing is that the first page prints as a single PDF. The second page prints as a two page PDF (1-2) the third page prints as a three page PDF (1-3) etc...Here's the script:
tell application "QuarkXPress"
tell project 1
set projectName to name
set pubCode to (characters 1 thru 2 of projectName) as string
set namePrefix to my GetPubPrefix(pubCode) -- omitted for brevity
-- Projects don't have pages, even in single layout mode,
-- so get the page list from layout space
tell layout space 1
set pageList to pages
set pageCount to count items of pageList
end tell
-- for some reason, the following loop doesn't work within the contextÂ
-- of the layout space, but does work in the project context
repeat with i from 1 to pageCount
set aPage to item i of pageList
set pageNumber to (name of aPage) as integer
if (pageNumber is in pageNumberList) then
-- temporary until print codes are created
set tempName to namePrefix & pageNumber as string
set name to tempName
-- since projects don't have pages, we need to target the layout space for the print
-- only display the print dialog for the first page
if (i = 1) then
print page i of layout space 1 copies 1 with print dialog
else
print page i of layout space 1 copies 1 without print dialog
end if
-- IMPORTANT: without setting the name back to the original name
-- the reference to the project breaks and the script throws an error
set name to projectName
end if
end repeat
end tell
end tell
I looked at the "print setup record" in the Quark dictionary, but it doesn't have any fields to specify page ranges.
Anyone know how I can get this script to print individual pages?
Thanks for any help