Skip to main content
appytastic
Participating Frequently
November 29, 2018
Answered

See what files parent link is linked to?

  • November 29, 2018
  • 3 replies
  • 3118 views

Hello!

Is there any way to figure out what files a parent document is linked to?

Example: I have used the content placer to link a block of text into 4 documents. How can I quickly figure out those 4 documents later from the parent document?

Thank you!

This topic has been closed for replies.
Correct answer rob day

Here is the link to my test files:

Dropbox - ID Link Test Files - Simplify your life

As you can see, the placed content shows the ID file name as usual, but is followed by a #<> where the <> contain the first portion of the grabbed content. So if there is a way to do the code where it looks for the file name but ignores everything after .indd I think it should work.


The code below seems to work on the files you posted. I'm using CC2018 on High Sierra.

I think the usage of parent and child is really confusing so I changed the dialogs a bit. The script now asks you to choose the placed file first, followed by the folder containing ID files to search through.

You might have to watchout for folders with too many files, you could run into memory issues.

(*

Rob Day 2015-2018

Opens all of the ID files in a chosen folder and checks for the parent of specified placed child file.

If the link name is not found document is closed

*)

global mylinkname

tell application "Finder"

   

    set the cFile to (choose file with prompt "Choose a Placed File to Search for.")

    set mylinkname to name of cFile

   

    set the dfolder to (choose folder with prompt "Choose a Folder containing InDesign Files to Search.")

    set flist to (every file of entire contents of folder dfolder) as alias list

   

    my checkLinks(flist)

    tell application "Adobe InDesign CC 2018"

        activate

    end tell

end tell

-------------------------------Functions----------------------------------

on checkLinks(flist)

    tell application "Finder"

       

        repeat with f in flist

            --check for InDesign fiiles

            if creator type of file f is "InDn" then

                tell application "Adobe InDesign CC 2018"

                    --activate

                    set user interaction level of script preferences to never interact

                    try

                        open f

                        tell active document

                            --use the links file path rather than the name

                            set llist to file path of every link

                            set nlist to my getNames(llist)

                            if mylinkname is not in nlist then

                                close

                            end if

                        end tell

                    end try

                    set user interaction level of script preferences to interact with all

                end tell

            end if

        end repeat

    end tell

end checkLinks

--gets the last item of the file path (the file name)

on getNames(theList)

    set nlist to {}

    set oldDelimiters to AppleScript's text item delimiters

    set AppleScript's text item delimiters to ":"

    repeat with x in theList

        set n to every text item of x

        copy last item of n to end of nlist

    end repeat

    return nlist

end getNames

3 replies

Participant
May 21, 2020

i think this script might be exactly what I am after - but it doesn't seem to work on my Windows machine. is it easy to convert to whatever version might be legible to my computer?

rob day
Community Expert
Community Expert
November 30, 2018

It should be scriptable, what OS are you using?

appytastic
Participating Frequently
November 30, 2018

I am using Mac OS Mojave

rob day
Community Expert
Community Expert
November 30, 2018

I think this question came up before and I might have something in my AppleScript library, will check later today.

maxwithdax
Community Expert
Community Expert
November 29, 2018

As long as you placed the content with the linked option checked then you can simply press command(ctrl) + Shift+D to open the links dialog box (window>Links) and see where they were linked. You can also right click and choose "reveal in explorer (finder)"

Hope that helps

-Dax

appytastic
Participating Frequently
November 29, 2018

Thank you for your response Dax- however it doesn't answer my question.

While that works for figuring out where the linked file originated from- I need to figure out how to find out the opposite path.

File A is linked to B, C, D, and E (the children)

I want to see that information while looking at file A (the parent).

Your response applies to if I have B, C, D or E open (unless I am really missing something).

Is there a way to do this?

Thank you!

maxwithdax
Community Expert
Community Expert
November 30, 2018

Ah... no..sorry. that is not possible at this time. Would be a nice feature request though. You would have to setup a "Watch directory" to know where to look though. Would be an interesting option. Might consider adding a feature request.

Feature Request/Bug Report Form

- Dax