RE: How to relink missing links in InDesign CS5
RE: How to relink missing links in InDesign CS5
- Subject: RE: How to relink missing links in InDesign CS5
- From: email@hidden
- Date: Tue, 31 May 2011 23:51:35 +0000
- Sensitivity: Normal
> (*
> Attempt to make a script to automatically relink missing links. All links are on a server volume.
> I moved thousands of images from one server volume to another. That's why I need this script.
> Can anyone tell me what goes wrong here? Or answer Questions 1, 2 and 3?
> *)
Hi Bert,
For Q1, I believe when using Applescript that it should only use the Applescript path. I haven't
thoroughly researched this though. Not sure about Q2 - I would think 'as string' would work just
fine and not sure why your code isn't compiling. For Q3, you need to work with an 'alias' path
so the script can find the actual file. I've attempted to reconstruct your code a bit. Not sure
it's what you're looking for, but hopefully it will give you some ideas.
Jay
----------
tell application "Adobe InDesign CS5"
tell document 1
set linkList to links
set errInfo to "" -- We'll display error if we can't relink an item
-------
repeat with x in linkList
if (x's status) is not normal then -- I usually check for any link that has an error
-- This should only return an AppleScript path with ":" separators
set linkPath to (x's file path) as string
-------
if "KS_Documenten:Projecten_NZ" is in linkPath then
set AppleScript's text item delimiters to "KS_Documenten:Projecten_NZ"
set linkPath to (linkPath's text items) -- Create a list of text items
set AppleScript's text item delimiters to "Klanten_A_Z:T"
set linkPath to (linkPath as string) -- Concatenate with new path
set AppleScript's text item delimiters to "" -- Reset TIDs
-------
try
-- Need to make our string (path) into an alias path
relink x to alias linkPath
-------
try
update x -- This can be helpful
end try
on error err
-- We'll store link name if error occurs
set errInfo to (errInfo & return & x's name)
end try
end if
end if
end repeat
-------
-- If an error occurs while trying to relink, we'll display it
if (count errInfo) > 0 then display dialog ("Can't relink:" & errInfo)
end tell
end tell
----------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden