Quark - duplicating line boxes

Hello

This is section of script is intended to insert a line on a Quark document and then step and repeat it (the number of repeats and the offsets being calculated variables).


tell application "QuarkXPress"
	tell front document
		tell current page
			set numberofcompanies to 25
			set CompLeadingMM to 5
			set v_offset to CompLeadingMM
			set h_offset to 0
			
			make line box at beginning with properties {bounds:{59.0, 11.4, 59.0, 212.0}, width:0, name:"1stDivider"}
			
			repeat with i from 1 to (numberofcompanies - 2)
				duplicate line box "1stDivider" to beginning
				tell line box "1stDivider"
					set {FD_VS, FD_HS, FD_VE, FD_HE} to bounds as list
					set FD_VS to FD_VS as number
					set FD_HS to FD_HS as number
					set FD_VE to FD_VE as number
					set FD_HE to FD_HE as number
					set bounds to {FD_VS + v_offset, FD_HS, FD_VE + v_offset, FD_HE}
				end tell
			end repeat
			
		end tell
	end tell
end tell

It works fine, except that the Y1 and Y2 points of the duplicated lines drift apart when they should remain the same for each line (giving a level line).

For example, if I duplicate the first line (Y1 - 59mm, Y2 - 59mm) once by 5mm the resulting line has a Y1 figure of 63.995mm and the Y2 of 64.004mm. It seems to be bracketing my desired result (59 + 5 = 64mm). The drift increase with every duplicated line.

Any ideas where I’m going wrong or what I’m not coercing properly.

Thanks in advance

Mark
[Quark 6.5
OS X 10.4.8]

Mark1,

Quark is great isn’t it? (Sarcasm).

Not sure why this happens. I have experienced this problem before too.

This is a work around (faster too):


tell application "QuarkXPress"
	activate
	tell front document
		tell current page
			set numberofcompanies to 25
			set v_offset to 5
			set startBounds to {59.0, 11.4, 59.0, 212.0}
			repeat with i from 0 to (numberofcompanies - 2)
				make line box at beginning with properties {bounds:{(item 1 of startBounds) + (v_offset * i), (item 2 of startBounds), (item 3 of startBounds) + (v_offset * i), (item 4 of startBounds)}, width:0, name:("Divider" & i + 1 as string)}
			end repeat
		end tell
	end tell
end tell

Hope this helps,
CarbonQuark

CarbonQuark

Yes, Quark is, shall we say, idiosyncratic.

However, you have triumphed over duplicated line drift.

Good couple of lines of code in there - thanks for your help

Mark