Stupid Quark ...WHY!!

I am trying to make a simple script for Quark 6 that will change all empty picture boxes to graphic boxes (I just hate the Xs :shock: ) …anyway, here is the script I have been using for some time. It works sometimes and doesn’t others.

tell application “QuarkXPress”
if (exists document 1) is false then error “No document is open.”
tell document 1
set content of (every picture box whose file path of image 1 of it is null) to none content
on error
display dialog “There are no empty picture boxes.” buttons {“OK”} default button 1 with icon note
end try
end tell
end tell

TODAY I finally figure out what the glitch is, but have no idea how to fix it …or go another route. If you have a document with empty picture boxes in it and no picture boxes WITH images it works just fine. As soon as you add an image to one of the picture boxes the script no longer works!?!? :x

Works fine with lines and text boxes …just not picture boxes that actually have pics in them. Stupid Quark…

Beats me, but classes filtered with whose clauses don’t always work the way they ought to in Quark. It seems like this is the case for you since the result of this…

every picture box whose file path of image 1 of it is null

is different depending on whether or not there are boxes that don’t pass the whose.

I usually cheat by getting rid of the whose clause. I.e. repeating through the results or a plain “every picture box” and then testing each one with an if xxx then…

This is really bad form, and much slower, but sometimes it’s the only way to get what you want.

I’ll wait until Quark 6.5 is released to work on it any further. I remember 6.0 had an AppleScript bug that wouldn’t let you resize the document. It was fixed in 6.1 …maybe this will be fixed in 6.5 :rolleyes: