Copy link to clipboard
Copied
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!
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 c
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Will be sure to do that Dax, thanks!
Copy link to clipboard
Copied
In Adobe Bridge you can right-click on your INDD-File to show ALL linked files…
Hope, that helps.
Copy link to clipboard
Copied
Right, but the OP wants to get a list of the ID files the linked file is placed in—the reverse of showing a chosen ID file's links.
I'm skeptical that the feature is possible. My script is searching through a chosen folder and checking every ID file's link list for a name match, but that doesn't mean all of the files containing the link are in that folder, or even on a local drive or network. If the search folder has hundreds of ID files the script might timeout or crash ID
Copy link to clipboard
Copied
It should be scriptable, what OS are you using?
Copy link to clipboard
Copied
I am using Mac OS Mojave
Copy link to clipboard
Copied
I think this question came up before and I might have something in my AppleScript library, will check later today.
Copy link to clipboard
Copied
Try this AppleScript.
It asks for an enclosing folder with the files to search for, and then asks you to choose a file that might be linked—the placed file can be anywhere. The script loops thru the chosen folder and leaves any files with the chosen file as a placed link open.
Open this .zip archive and copy the script inside to your ID scripts folder
Copy link to clipboard
Copied
Thank you for that scrip Rob! I tested it out and it looped through the process but did not leave the linked file open as it sounded like it is supposed to do.
I tested it by running the script using the parent file (per my needs- I know where the parent is at all times, I'm just trying to gather in the children to sync updates), and it did not recognize the file with the child in the folder I specified.
I also ran it on the child with the same result.
I appreciate your help on this and did fill out a feature request.
Copy link to clipboard
Copied
I think we might be reversing the meaning of child and parent—I think of child as the placed link and its parent as the ID file with the child placed.
So here the folder I'm going to search is FolderToSearch, which has 3 InDesign files with links in the folder PlacedChildren:
The script then asks for a file that might be placed in any of the FolderToSearch files, and I choose ChildA.indd
ChildA.indd is placed in Parent1wA and Parent2wA, so they are left open:
Here's a Dropbox with my test files:
Copy link to clipboard
Copied
With your test files, the script is working (and yes, it does exactly what I am looking for)
And yes, our wording does seem to be reversed- I call the document with the placed link the child, and the file holding where the original content is (where the universal editing would occur) the parent. 😃
With my files it is not working however. It's running through the proper file and is doing it's thing- but on my test file it is not leaving open the document where the link has been placed.
I think the script isn't working because I placed the content using the content place tool. (yes, the content is still definitely linked) I did not place an indd doc within another indd doc
How my parent file is named: Parent-ud.indd
How it displays in the link panel: Parent-ud.indd#<Test text...>
Is there a way to adjust the script to look for the file name but allow for the variables (#< text >) that follow it? So basically the if statement "if mylinkname is not in llist then"... has a beginning or contains statement (or something more appropriate- I can get around reading applescript but I don't have much experience writing it), I think this would fix the problem.
What would you suggest?
By the way, have I mentioned you're awesome Rob?
Copy link to clipboard
Copied
How it displays in the link panel: Parent-ud.indd#<Test text...>
That probably is the problem. I'll take a look and see if there's an easy fix.
Copy link to clipboard
Copied
How my parent file is named: Parent-ud.indd
How it displays in the link panel: Parent-ud.indd#<Test text...>
Can you dropbox me an example with the variable usage?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Im unable to check your file (firewall), but am I missing something here? When I place an InDesign-file into InDesign, i can expand the tree to see whats inside the linked InD-file, and check their paths.
Copy link to clipboard
Copied
Please start reading from the beginning thread for clarity. He is looking for a way to lookup every InDesign file a source might be linked to.
"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)."
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
This worked perfectly!
Thank you so much Rob!
Copy link to clipboard
Copied
Rob, your script works beautifully, but has one issue for me. The files it searches through have multiple linked files with the same file name (from different locations). Can the script be adjusted to search the whole file path instead?
Copy link to clipboard
Copied
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?