Re: Big thank you Jay, and the next question is...
Re: Big thank you Jay, and the next question is...
- Subject: Re: Big thank you Jay, and the next question is...
- From: Hans Haesler <email@hidden>
- Date: Sun, 24 Nov 2002 20:36:10 +0100
On Sun, 24 Nov 2002, bartbe wrote:
>
No cigar, guys, if i leave the box type check in there there is no way it
>
runs. If I take the type check out, it works. If the box i select is NOT a
>
graphic box, nothing happens. Might not be state of the art, but it works.
>
>
-----------------------------
>
if (current box exists) and (box type of current box is picture box
>
type) and ((data size of image 1 of current box) 1) then
>
-----------------------------------
Hi bartbe,
you're running QXP 4.04, right? Now, with the upgrade to 4.0, and the
subsequent update to 4.04 there have been many changes (in the wrong
direction).
The good old 'box type' from QXP 3.32 didn't work anymore. That's
the reasom why you did have an 'obsolete' in your code.
With QXP 4.04 you must ask for the 'content' of the selected box
('box type' has been restored with QXP 4.1).
---
if (current box exists) and (content of current box is picture content) and ((data size of image 1 of current box) is greater than or equal to 1) then
---
Since your way of addressing the selected box would return a wrong
error message when the selected box is an _empty_ picture box, I have
modified the script a little bit:
---
tell document 1 of application "QuarkXPress 4.04"
activate
try
tell current box
set boxContent to content
end tell
on error
display dialog "There is no selected box." buttons "OK" default button 1 with icon 2
end try
if boxContent is picture content then
tell current box
if bounds of image 1 is not {0, 0, 0, 0} then
set bounds of image 1 to proportional fit
set offset of image 1 of current box to {0, 0}
else
display dialog "The selected box is empty." buttons "OK" default button 1 with icon 2
end if
end tell
else
display dialog "Oops, didn't see an image box." buttons "OK" default button 1 with icon 2
end if
end tell
---
Note that I have deleted all the stuff which gets the percent values,
compares and swaps and applies them, because the result is exactly the
same without these lines.
If you're goal is to fit the image to the box with the smallest
possible percentage value then please come back.
---
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.