Variable-sized text boxes in Quark: stop the overrun!

Does anyone know of a way of forcing Quark XPress 5 to (re-)size a textbox according to the length of the text to be inserted?

I suppose that this can be done by counting the characters in the string, which is then divided by a fixed width to return a variable for the length…but there must be an easier way to do this?

Any ideas?

Thx.

P

Can’t help you with Quark 5 but this works with Quark 6 & OS 10.3.6:


tell application "QuarkXPress"
	tell document 1
		set ThisBox to current box --"Current box" is whatever box is currently selected.
		if box overflows of ThisBox is true then
			set BottomOfBox to bottom of bounds of ThisBox as number
			repeat until box overflows of ThisBox is false
				set BottomOfBox to BottomOfBox + 0.01
				set bottom of bounds of ThisBox to BottomOfBox
			end repeat
		end if
	end tell
end tell

That seems like a very good solution
the only problem i could forsee is if the copy is greater than what will fit on the page size

so he may need to escape that possible error

unless you know the copy wont flow that long

I understand that this solution works, however, I get "Can’t make “data FXVM00810000” into a number when I try to use the script. Does anyone have a solution for this?

Interestingly, if I set BottomOfBox as string, I get the same error, but if I set BottomOfBox as the button returned of a dialogue, it is a number with mm.

Is there any way to link two text boxes with AS?

i am not to experienced with scripting quark

first of all are the boxes on the same page that you want to link?

if not
you could use auto text box then a new page would be created if the first one overflows
you would automatically be on the next page

also you may be able to use some of the code in the scripts supplied with quark in the folder
Macintosh HD:Applications:QuarkXPress 6.0:Scripts:Stories:Link Selected Text Boxes…