I’m trying to delete a master page in Quark, using this code:
tell application “QuarkXPress”
activate
delete spread 2 of master document 1
end tell
It just errors out, with this message:
QuarkXPress got an error: spread 2 of master document 1 doesn’t understand the delete message.
I had this working yesterday, maybe with different code, but i set it aside without saving changes when i went to do somethig else. Anyone know what syntax to use for deleting a spread?
Just let you know, when you delete the page is the spread number not the page number. So spread 2 delete page 2. You can’t go pages contain name “A - Master A” as it get the non spread page number and delete the wrong page. Even if you tell spread delete page 1 and 2 it also get the non spread page number and deletes the wrong page.
When you delete a page it deletes the spread (2 pages)
Best way is, delete in reverse order
tell application "QuarkXPress"
activate
tell master document 1
show
set MastersAvailable to name of every spread
set ToDelete to {"A-Master A", "C-Master C"}
repeat with i from (count of MastersAvailable) to 1 by -1
if ToDelete contains name of spread i then
delete page i
end if
end repeat
end tell
end tell