🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17784

Re: Script to check for unlinked images

#17784
From: Richard Ronnback
Date: Sat, 17 May 2003 09:18
58 lines
2481 bytes
Thanks for the tips. I will soon have to start creating some kind of order for my scripts (as a newbie they tend to multiply)

Anyway, here is a revised version that seems to work better and (hopefully) will catch inline images, table images, images in groups etc.



 
tell application "InDesign 2.0.2" 
	activate 
	tell active document 
		set myOkFlag to true 
		set myImages to images of all page items

		repeat with i in myImages 
			if item link of i is {} then 
				set myOkFlag to false 
				set myParent to parent of parent of i

				try 
					repeat until class of myParent is page 
						set myParent to parent of myParent 
					end repeat 
					set mySpread to parent of myParent

				on error 
					set myParent to parent of parent of i 
					repeat until not (parent text frame of myParent is {}) 
						set myParent to parent of myParent 
					end repeat 
				end try



				set active spread of window 1 to mySpread 
				select i 
				select nothing 
				tell application "InDesign 2.0.2" 
					tell active window 
						zoom given fit spread 
					end tell 
				end tell 
				select i 
				set myAlert to display dialog "The selected image is not linked. Cancel will exit so you can correct the image. Continue will check for other unlinked images." with icon stop buttons {"Cancel", "Continue"} default button "cancel" 
				if button returned of myAlert is "Cancel" then 
					exit repeat 
				end if 
			end if 
		end repeat

		if myOkFlag is true then 
			display dialog "This document contains no unliked images" 
		end if

		if myOkFlag is false then 
			display dialog "The script is finished" 
		end if 
	end tell 
end tell 
Technical Details
Message-ID: <1de927bb.3@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de927bb.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,9020e8d2265f17ed
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-17 02:38:32 PST
From: "Richard Ronnback" <richard.ronnback@telia.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Script to check for unlinked images
Message-ID: <1de927bb.3@WebX.la2eafNXanI>
Date: Sat, 17 May 2003 02:18:17 -0700
References: <1de927bb.-1@WebX.la2eafNXanI>
Lines: 61
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit