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
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"
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")