Re: QXP Placing an image to the bottom
Re: QXP Placing an image to the bottom
- Subject: Re: QXP Placing an image to the bottom
- From: Shane Stanley <email@hidden>
- Date: Tue, 11 Sep 2001 08:43:15 +1000
On 11/9/01 12:49 AM +1000, Mark Bjfrgager, email@hidden, wrote:
>
When placing an image in a picture box, I want the image to be placed to
>
the bottom of the picture box.
>
>
I tried to do some math in QXP, but somehow the returned values are screwed
>
up (pardon my french)
>
>
Here's my script:
>
>
tell boxIndex
>
set bounds of image 1 to proportional fit
>
set boxHeight to height of bounds of it
>
set imgBounds to the bounds of image 1
>
set imgHeight to item 4 of imgBounds
>
set imgOffset to ((boxHeight as real) - imgHeight as real)
>
set offSet of image 1 to {imgOffset, 0}
>
end tell
>
>
But it returns some obscure valu (-38,41) which is wrong.
>
>
Is there some magic command that I can use ?
No magic, but steer clear of "bounds of image" -- it's unreliable. Try
something like this:
tell application "QuarkXPress 4.11"
tell document 1
tell picture box 1
set theHeight to height of bounds as real
set bounds of image 1 to exact fit
set {a, b} to (scale of image 1) as list
set yOffset to theHeight - 100 / (a as real) * theHeight
set scale of image 1 to {100, 100}
set offset of image 1 to {yOffset, 0}
end tell
end tell
end tell
--
Shane Stanley, email@hidden