Re: Quark Q&A : Big Thank You Jay ! and the next one...
Re: Quark Q&A : Big Thank You Jay ! and the next one...
- Subject: Re: Quark Q&A : Big Thank You Jay ! and the next one...
- From: Greg Robb <email@hidden>
- Date: Mon, 25 Nov 2002 23:34:59 -0800
You're right, that's an old reference,
It works for me like this:
tell application "QuarkXPress 4.1"
activate
try
if (current box exists) and ,
(box type of current box is picture box type) and ,
((data size of image 1 of current box) > 0) then
tell front document
set bounds of image 1 of current box to proportional fit
set imageScale to scale of image 1 of current box as list
set imageHeight to item 1 of imageScale as real
set imageWidth to item 2 of imageScale as real
if imageWidth > imageHeight then
set newPercent to item 2 of imageScale --the width
else
set newPercent to item 1 of imageScale -- the height
end if
set scale of image 1 of current box to {newPercent, newPercent}
set offset of image 1 of current box to {0, 0}
end tell
else
display dialog "Oops, didn't see a selected picture box with an image."
end if
on error errText number errNum
if errNum = -128 then
else
beep (display dialog errText)
end if
end try
end tell
I also changed the first error message to cover all trapped properties and
the second to not display that the user canceled.
-Greg Robb
_______________________________________________
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.