Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: misleading Quark picture box



On Wed, 26 Nov 2003, Wallace, William wrote ...

<snip>
> if image 1 exists
<snip>
>(...) Is there a way to test reliably if a picture box actually
>contains a picture?


... and Michael Slomski replied:
<snip>
> if file path of image 1 is not null then
<snip>


Hello Bill,

Michael is close (hello Mike :-) but his code doesn't cover pasted PICTs.
---
tell document 1 of application "QuarkXPress 4.11"
tell current box
if bounds of image 1 is not {0, 0, 0, 0} then
if (file path of image 1) is not null then
display dialog "The picture box contains an imported image."
else
display dialog "The picture box contains a pasted PICT."
end if
else
display dialog "The picture box is empty."
end if
end tell
end tell
---

Or:
---
tell document 1 of application "QuarkXPress 4.11"
tell current box
if (file path of image 1) is null then
if bounds of image 1 is {0, 0, 0, 0} then
display dialog "The picture box is empty."
else
display dialog "The picture box contains a pasted PICT."
end if
else
display dialog "The picture box contains an imported image."
end if
end tell
end tell
---

Okay... I've seen _one_ ***empty*** picture box which returned
{32767, 32767, 32767, 32767} and the script thought -- of course --
that it contained an image.

---
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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.