Quark--recto & verso pages--How?

I am writing a script that will create a book from individual chapter manuscripts. I’m doing fine so far, however, I have run into a problem. Each chapter needs to begin on a recto page. How do I ask Quark if the last page of the previous chapter is verso or recto and how (If it is recto) do I insert a blank verso page to begin the next chapter on a recto? Thanks, Don

It’s very important to insert a blank verso page. Just because there’s nothing on it, it still needs to be accounted for. A 60 page book with four blank pages is still 60 pages, not 56… I’m sure you know this but I’m just giving an example of my reasoning.
To get the last page of a document try this (assuming the document is open and frontmost)

tell application "QuarkXPress 4.11"
	tell document 1
		if (page number of page -1) mod 2 = 0 then
			make new page at end with properties {master spread:"B-Master B"}
		end
	end
end

“B-Master B” should be changed to the name of the master page you’re using for your verso page.
Hope this helps,
Juerg

: It’s very important to insert a blank verso page. Just because
: there’s nothing on it, it still needs to be accounted for. A
: 60 page book with four blank pages is still 60 pages, not
: 56… I’m sure you know this but I’m just giving an example of
: my reasoning.
: To get the last page of a document try this (assuming the
: document is open and frontmost)
: tell application “QuarkXPress 4.11”
: tell document 1
: if (page number of page -1) mod 2 = 0 then
: make new page at end with properties {master spread:“B-Master B”}
: end
: end
: end
: “B-Master B” should be changed to the name of the
: master page you’re using for your verso page.
: Hope this helps,
: Juerg
Thanks!! Here’s what I’ve got:

repeat
  if (page number of page -1) mod 2 = 0 then 
    exit repeat 
   make page at end
end repeat

The only problem with this script is that it doesn’t create a blank page, it creates a page from my master spread, which then gets filled with text when the next file is imported. So my question is this: How do I create a blank page–i.e. with no text box or anything? (of course, I could always make a new master spread with nothing on it, but I’d like to know how to make a blank page nonetheless) Thanks much, Don

Hi Don,
Leave your code as it is but after ‘make page at end’ insert this…
delete every generic box of page -1
This should delete every item on the page including lines, bezier boxes etc. I’ve tested it on a page using every tool to draw a shape and it works. Your script will still add a page using a master spread but that’s OK because as soon as it does you delete everything that’s on it!
Of course, if there’s only 1 text box on the page you can use -
delete every text box of page -1
or
delete text box 1 of page -1
Just change the class to delete what ever it is you want to delete. If you’re positive you want to delete everything then I’d just stick with the first example.
Hope this helps,
Juerg

OK, I’ve just had a look in the XPress dictionary. Use this line instead of the line in my last post…
make new page at end with properties {master spread:single sided blank master}
That should do nicely! :slight_smile:
Juerg

Juergen, You Rock! Don’t let anyone tell you differently!
Actually, your first suggestion worked best for my needs, as delete text box 3 of page -1 allows me to keep a running head and page number; it just deletes the main text box. (although make new page at end with properties {master spread:single sided blank master} is definitely useful info to have for future reference!)
Thanks so much! --Don

Well, I’m just pleased you’re script’s now functioning as it should! :slight_smile:
I didn’t know how to insert a blank page either until now so I guess we both learnt something new! That’s the beauty of such forums and BBS such as this.
Take care,
Juerg