Re: Adjusting height of textbox in Qxp
Re: Adjusting height of textbox in Qxp
- Subject: Re: Adjusting height of textbox in Qxp
- From: Frank Miedreich <email@hidden>
- Date: Thu, 25 Oct 2001 23:24:13 +0200
At 11:02 Uhr -0400 25.10.2001, Jeff Horton wrote:
Is there a way to push up the bottom of a text box up to the last paragraph?
What I have is a script to delete out paragraphs and after is done deleting
it pushes up the resizes the text box to the last paragraph. But my way
takes about 10-15 seconds per box. I know there is a faster way of doing
this, is there a command in Quark that you set the box to fit to text?
Right now I read in the font size of the 1st character of every line, it
works, but is inconsistent and slow.
Thanks
Jeff Horton
Hi, sure there is.
It may sound complicated, but here is the script:
tell application "QuarkXPress Passport 4.11"
activate
tell document 1
tell current box
repeat while box overflows
set height of bounds to (((height of
bounds as point units) as real) + 100) as point units
do updates
end repeat
set height of bounds to ((baseline of last
line as point units as real) + (descent of last line as point units
as real) + 1 as point units)
end tell
end tell
end tell
The repeat loop will not be necessary if you know the box does not
initially overflow. XPress returns incorrect info for last line when
the box overflows. The ugly conversions are neccessary as I have not
found a way to do calculations with measurement units. The + 1 is
needed as the box would otherwise choke on the last line. The script
fails if there is a single word with subscript character style on the
last line. To be on the save side you can add a second repeat loop
identical to the first but with an adjustment of a single point after
the height adjustment line.
Cheers, Frank