how to search the missing links in a folder have number of subfolders

Hi Team,

I have a indesign document with missing links. I will display the missing links list, but i need to search those missing links in a folder which has number of sub folders. can anyone help me in this.

the below script for display the missing link list
tell application “Adobe InDesign CS3”
tell document 1
set docName to name of it
set linkList to name of links whose status is link missing
end tell
end tell

set text item delimiters to return
set linksText to linkList as string
set text item delimiters to return

set theTitle to "Missing Links of document " & quote & docName & quote

tell application “TextEdit”
set newDocument to make new document
set text of newDocument to theTitle & return & “-------” & return & linksText
end tell

regards
gopala

Hi,
Do you want to link the images to the folder/subfolders?
If yes, try this:

set mainFolder to (choose folder)
tell application "Finder"
	set subFolders to every folder of entire contents of mainFolder as alias list
end tell

tell application "Adobe InDesign CS3"
	tell document 1
		set theLinks to every link whose status is link missing
		repeat with i from 1 to count of theLinks
			set thelink to item i of theLinks
			set theName to name of thelink as Unicode text
			repeat with eachFolder in subFolders
				set newpath to (eachFolder as Unicode text) & theName
				try
					relink thelink to newpath
				end try
			end repeat
		end repeat
	end tell
end tell
display dialog "Done, check the links" with icon path to resource "ID_App_Icon.icns" in bundle (path to application "Adobe InDesign CS3"

–Peter–

hi Peter,

thanks for your help and still it(script) is not searching the missing links of indesign document.

–goala

hi Peter,

thanks for your help and still it(script) is not searching the missing links of indesign document.

–goala

That’s strange…

I tested the script and it works just fine…
Are you sure you’re using Indesign CS3?

–Peter–

Hey, Peter. Your example doesn’t account for files at the root level; that’s probably the issue.

Your’e right Marc.

It’s a bit quick an dirty but this should solve the proble of the root Folder:

set mainFolder to (choose folder)
tell application "Finder"
	set subFolders to every folder of entire contents of mainFolder as alias list
end tell

tell application "Adobe InDesign CS3"
	tell document 1
		set theLinks to every link whose status is link missing
		repeat with i from 1 to count of theLinks
			set thelink to item i of theLinks
			set theName to name of thelink as Unicode text
			set newpath to (mainFolder as Unicode text) & theName
			try
				relink thelink to newpath
			end try
		end repeat
	end tell
end tell

tell application "Adobe InDesign CS3"
	tell document 1
		set theLinks to every link whose status is link missing
		repeat with i from 1 to count of theLinks
			set thelink to item i of theLinks
			set theName to name of thelink as Unicode text
			repeat with eachFolder in subFolders
				set newpath to (eachFolder as Unicode text) & theName
				try
					relink thelink to newpath
				end try
			end repeat
		end repeat
	end tell
end tell
display dialog "Done, check the links" with icon path to resource "ID_App_Icon.icns" in bundle (path to application "Adobe InDesign CS3")

Thanks, it is searching but it is not giving any sort of message like is it available in that root or not.

So what you want is a dialog/message or log file in case files are not found ?

–Peter–

Hi Peter,

I need a text log file which is available in that location or not