How to get box position in Quarkxpress 6.5

Hi All,

I am writing a script to move all boxes and lines from one page to its previous page. (For example from page 3 to page 2)

Here What I want is, If box “A” is placed at infront of box “B”, then the same appearence should come after the boxes are moved to previous page.

I had written a script to move the boxes to previous page. It works fine. But the problem is, the appearance is not same after the boxes are moved. The boxes are interchanged after moved.

My script is:


property y1 : {}
property bds : {}

tell application "QuarkXPress"
	tell front document
		set horizontal measure to points
		set vertical measure to points
		set page rule origin to {"0 pt", "0 pt"}
		repeat with pagecount from 2 to count of pages
			try
				set allboxes to uniqueID of every generic box of page pagecount
				if pagecount mod 2 is equal to 0 then
					repeat with eveni in allboxes
						set y1 to ""
						set bds to bounds of generic box id eveni as list
						set item 2 of bds to (((item 2 of bds as real) + 24)) as string
						set item 4 of bds to (((item 4 of bds as real) + 24)) as string
						set y1 to (move generic box id eveni to beginning of page (pagecount - 1))
						set bounds of generic box id eveni to bds
                                                -------------------------------------------------------------------------------------------------------------------
                                               --////// Here I want to set the box position same as its previous position ////////
                                                --------------------------------------------------------------------------------------------------------------------
					end repeat
				else if pagecount mod 2 is equal to 1 then
					repeat with oddbox in allboxes
						set y1 to ""
						set bds to bounds of generic box id oddbox as list
						set item 2 of bds to (((item 2 of bds as real) - 24)) as string
						set item 4 of bds to (((item 4 of bds as real) - 24)) as string						
						set y1 to (move generic box id oddbox to beginning of page (pagecount - 1))
						set bounds of generic box id oddbox to bds
                                                -------------------------------------------------------------------------------------------------------------------
                                               --////// Here I want to set the box position same as its previous position ////////
                                                --------------------------------------------------------------------------------------------------------------------
					end repeat
				end if
			end try
		end repeat
end tell
end tell

Could any one help me how to do this.

Thanks,
Gopal

Try using origin of bounds which used to be the top left x and y coordinates of the object.

Hi Jerome,

I have tried using x, y coordinates. But the Front and Back position of the BOX will not come as same.

Could you tell me how to get this.

Thanks,
Gopal

I have not scripted Quark since 4.11 so thing may have changed. I don’t have a copy of Quark to test either. However if you change the line:

set bds to bounds of generic box id eveni as list

to

set bds to origin of bounds of generic box id eveni as list

you should get the x,y coordinates of the object. Sorry I can’t be of more help.

You state to move the item ‘to beginning of page’ in a forward loop this will end up with your items in the reverse stacking order as each item going down the stacking order of one page gets moved to the top of the stacking order of the previous page try changing ‘beginning’ to ‘end’ untested.