Skip to main content
Legend
June 1, 2015
Question

relink … {look for broken links in this folder: true}

  • June 1, 2015
  • 1 reply
  • 932 views

Hello there,

i'm currently automating linking after a server migration with new folder structure, so far so good.

I have a bunch of folders who contain a huge chunk of that missing files.

For far as I am, I fetch

set MyBrokenLinks to (every link whose status is link missing)

repeat with k from 1 to (length of MyBrokenLinks)…

and batch-relink them to specific paths on our new server.
My script could speed up greatly if I could only use the InDesign-Feature to look in thet new given relink folder for broken links, as shown in my Screenshot.

Am I able to applescript the use this InD-feature?

This topic has been closed for replies.

1 reply

Inspiring
June 1, 2015

-- I've never seen that UI feature scripted, so I always use something like this:

set newFD to "HardDrive2:Links-New:" -- new source folder of links

tell application "Adobe InDesign CS6"

  tell document 1

  set eflag to 0

  try

  set myBrokenLinks to object reference of (every link whose status is link missing)

  on error

  display dialog ("No missing links found.")

  set eflag to 1

  return

  end try


  if eflag = 0 then

  set oldTIDs to AppleScript's text item delimiters

  set AppleScript's text item delimiters to ":"

  repeat with i from 1 to count of myBrokenLinks

  set oldFP to (file path of item i of myBrokenLinks) as string

  set newFP to (newFD & (last text item of oldFP)) as string

  relink item i of myBrokenLinks to alias newFP

  end repeat

  update every link

  set AppleScript's text item delimiters to oldTIDs

  end if

  end tell

end tell

DBLjanAuthor
Legend
June 2, 2015

Thank you, but I cylce thru 200-400 links, and for each link i "scan" the file path and do various searches onto that string and change it to specific folders, so handling 300 links is kinda slow. But if InDesign could look in every relinked folder for more matches, i could save up 150 links.

Look at my screenshot below. This broken link would handle in a single click, but with scripting i have to cycle thru all my links.

Also this file is merged together in a folder with many logos, if InD would "look for matching broken links in this folder" it would find 100-ish matches.

But if i cant script that – thats a pity…maybe someone else has any ideas how to achiv this with ease.

Inspiring
June 2, 2015

Shirley Hopkins would know. I noticed she posted an answer to a different question today, so maybe she will offer a definitive answer here.

ps I just had a thought: another possibility is the invoke menu action command.