Quark6, how to delete empty picture boxes with NO background color?

Please can somebody help me? For Quark 6 i urgently need help for a script for deleting all empty picture boxes without a background color.
Who knows how to do?
Sorry - i’m a beginner…
Regards from Munich
Silentium

Model: PowerBookG4
Browser: Safari 312.3.1
Operating System: Mac OS X (10.4)

Hi Silentium,
try this for XPress 6 (also works for 4+5):

tell application “QuarkXPress Passport”

if exists front document then
	tell front document
		
		set BoxToDeleteList to {}
		set picBoxcount to count every picture box
		
		repeat with i from 1 to picBoxcount
			
			tell picture box i
				try
					if file path of image 1 = null then
						if name of color = "Kein" or name of color = "None" then
							set BoxToDeleteList to BoxToDeleteList & uniqueID
						end if
					end if
				end try
			end tell
			
		end repeat
		
		repeat with i in BoxToDeleteList
			tell (every picture box whose uniqueID = contents of i)
				delete
			end tell
		end repeat
	end tell
end if

end tell

greets
TMA

Hello TMA, YOU are as good as gold…
Hey, it worx - and your help was really speedly!

This was my last resource…
Because a dokument i work with has really a LOT of those fu… empty boxes
and it lasted over 20 minutes since Quark was awaking again from saving this file!
And now without that ballast saving is REALLY faster!
This was a stroke of genius!

How could i thank you? What can I do for you?
Have you got a PayPal account? I just want to donate sth.

There is only one problem left for me:
How is it possible to distinguish between boxes with a black border (line) or none,
and how to prevent the boxes with a border from being deleted?

Thanx Silentium

Model: PowerBookG4
Browser: Safari 312.3.1
Operating System: Mac OS X (10.3.9)

Hi Silentium,
eat this:


tell application "QuarkXPress Passport"
	
	if exists front document then
		tell front document
			
			set BoxToDeleteList to {}
			set picBoxcount to count every picture box
			
			repeat with i from 1 to picBoxcount
				
				tell picture box i
					try
						if file path of image 1 = null then
							if name of color = "Kein" or name of color = "None" then
								
								set tmpFrameWidth to width of frame
								set tmpFrameWidth to coerce tmpFrameWidth to integer
								if tmpFrameWidth = 0 then
									set BoxToDeleteList to BoxToDeleteList & uniqueID
								end if
								
							end if
						end if
					end try
				end tell
				
			end repeat
			
			repeat with i in BoxToDeleteList
				tell (every picture box whose uniqueID = contents of i)
					delete
				end tell
			end repeat
		end tell
	end if
end tell

greets
TMA

P.S.: Falls ich mal in München bin, gibst du mir n paar Bierchen aus…

Hi TMA,
wow, that’s great — but… are you german?
Of course there will be a lot of beers for you, let me know, when you come over!

…it’s a bit embarrassing… ahem… there is one further problem (the last one…)
is it possible to tell the script which pages it should run and delete those rubbish
empty picture boxes?
I mean for example: from page 1 to 5 delete…
sorry, is this awkward?

Now a donation or a BIG BEER BARREL should become true…

Regards Silentium

Model: PowerBookG4
AppleScript: AppleScript D1-1.9.3
Browser: Safari 312.3.1
Operating System: Mac OS X (10.3.9)

Hi

I am not too good like TMA, but few months ago I have develop the same type of script.

Open the quark document and run the code.


tell application "QuarkXPressâ„¢ 4.1"
	activate
	tell front document
		set tool mode to drag mode
		set tot to count of every picture box
		repeat with i from tot to 1 by -1
			if anchored of picture box i then
				select picture box i
				cut current box
			else
				delete picture box i
			end if
		end repeat
		
		display dialog "Total of " & tot & " picture boxes
has been deleted successfully." buttons {"OK"} default button 1
		set cc to count of every generic box
		repeat with i from 1 to cc
			select generic box i
			if color of current box is not equal to null then
				set color of current box to null
			end if
		end repeat
	end tell
end tell

Hey Macrajeev, thanks a lot for your script!
But this deletes ALL of the pic boxes…
TMA solved my problem with the boxes WITHOUT a background color.
Greets from Munich
Silentium