Re: applescript-users digest, Vol 3 #1389 - 13 msgs
Re: applescript-users digest, Vol 3 #1389 - 13 msgs
- Subject: Re: applescript-users digest, Vol 3 #1389 - 13 msgs
- From: Scott Lewis <email@hidden>
- Date: Thu, 27 Feb 2003 14:10:07 -0400
Thanks, Hans. That is exactly what I was looking for.
Scott Lewis
email@hidden
>
Hello Scott,
>
>
I'm using the following script which fits the image to the box with the
>
smallest possible percentage. But it adds about half a percent to be on
>
the safe side: the offset values must be negative ones, especially when
>
the box has a frame (else, there will be a white hairline for sure):
>
---
>
tell document 1 of application "QuarkXPress 4.11"
>
activate
>
tell current box
>
tell image 1
>
if bounds is not {0, 0, 0, 0} then
>
set bounds to exact fit
>
set {yP, xP} to scale as list
>
set yP to yP as real
>
set xP to xP as real
>
if yP > xP then
>
set yP to ((yP + 0.5) div 0.1) / 10
>
set xP to yP
>
else
>
set xP to ((xP + 0.5) div 0.1) / 10
>
set yP to xP
>
end if
>
set scale to {yP, xP}
>
set bounds to centered
>
end if
>
end tell
>
end tell
>
end tell
>
---
>
With 'set bounds to centered' the image is centered in the box. No need
>
for trying to compute the offset values.
>
>
---
>
Hans Haesler <email@hidden>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.