10 Replies Latest reply on Mar 20, 2017 6:57 AM by rob day

    Is there a script/utility to monitor/flag any link outside a specified folder?

    JointyJr Level 2

      As far as I'm aware the only way to see if all images are in the proper folder is to:

       

      Look and their paths - can take and age depending on the quantity

      Copy the whole job folder to the desktop/disconnect to the server, open the INDD file and see what's missing - takes an age

      Package it, then compare images - not useful if the images are in multiple folders

      "copy links to" - again, not useful if the images are in multiple folders, as duplication will occur

       

      (Mac OS Sierra / Indesign CC 2017)

        • 1. Re: Is there a script/utility to monitor/flag any link outside a specified folder?
          John Mensinger Adobe Community Professional & MVP

          Hmmm...you really haven't stated a clear objective other than:

          ...to see if all images are in the proper folder...

          But then it seems as though you contradict the notion of "proper folder," by disqualifying packaging, which essentially guarantees (copies of) all linked images are in "the proper folder".

           

          It's not that I'd argue with you with regard to duplication (acknowledged by the reference to 'copies of' above), but realistically, you can't have it both ways; a single, "proper folder" containing all a document's linked images, and zero duplication. If, over the editing history of a document, images were placed from multiple folders outside of the one you'd consider "the proper folder", it's reasonable to assume the images reside in those other locations for a reason; perhaps they are placed in other documents as well.

           

          Where most of my work is carried out, we embrace that duplication and package everything for archiving and life-cycle control; ensuring that no document is dependent on a linked graphic that could become unavailable. Storage is cheap.

          • 2. Re: Is there a script/utility to monitor/flag any link outside a specified folder?
            JointyJr Level 2

            The 'proper folder' in question is the current project inks folder. I want to see if there are links from previous jobs in the current project/job.

             

            Anywhere.jpg

             

            These are live jobs and I want to keep tabs on what's linked. If a previous job is archived/moved/renamed while this one is live, and there's a link to that job, then the link will go missing.

             

            When the job is signed off then packaging is done and ready to archive.

            • 3. Re: Is there a script/utility to monitor/flag any link outside a specified folder?
              rob day Adobe Community Professional & MVP

              It would be scriptable. You could try this AppleScript, which asks you to choose a folder then makes a list of all links not in that folder:

               

              tell application "Adobe InDesign CC 2014"

                  set fname to choose folder with prompt "Select a destination folder"

                  set linklist to ""

                  tell active document

                      repeat with theLink in every link

                          set theLinkPath to file path of theLink as alias

                          tell application "Finder"

                              set a to name of parent of theLinkPath

                              set b to name of fname

                          end tell

                          if a is not equal to b then

                              set n to name of theLink

                              set linklist to linklist & n & return

                          end if

                      end repeat

                  end tell

                  display dialog "These placed files are not in the selected folder:" & return & linklist

              end tell

              2 people found this helpful
              • 4. Re: Is there a script/utility to monitor/flag any link outside a specified folder?
                Eugene Tyson Adobe Community Professional & MVP

                Select all your links in the links panel and copy to folder.

                 

                http://indesignsecrets.com/copy-all-your-linked-images.php

                 

                It won't copy anything into the folder twice - it just copies what's not there + it relinks them to that folder.

                • 5. Re: Is there a script/utility to monitor/flag any link outside a specified folder?
                  JointyJr Level 2

                  Cheers Rob, I'll give it a spin tomorrow.

                  • 6. Re: Is there a script/utility to monitor/flag any link outside a specified folder?
                    JointyJr Level 2

                    Yeah but like I said:

                     

                    "copy links to" - again, not useful if the images are in multiple folders, as duplication will occur

                     

                    Indesign doesn't look inside sub folders, just chucks them in one big bucket

                    • 7. Re: Is there a script/utility to monitor/flag any link outside a specified folder?
                      JointyJr Level 2

                      Hi rob, sorry about the long delay in responding. Gave it a whirl but this happened:

                      Screen Shot 2017-03-20 at 08.20.05.png

                      not knowing anything about scripting I really don't know what this means

                       

                      BTW I'm using Adobe InDesign CC 2017, I changed that in the script you posted.

                      • 8. Re: Is there a script/utility to monitor/flag any link outside a specified folder?
                        rob day Adobe Community Professional & MVP

                        It means you didn't get the entire code when you pasted or something happened when you edited.

                         

                        Try this, paste it into the Script Editor application and click Compile. If that doesn't work I can post a compiled version

                         

                        --------------------------------

                        tell application "Adobe InDesign CC 2017"

                            set fname to choose folder with prompt "Select a destination folder"

                            set linklist to ""

                            tell active document

                                repeat with theLink in every link

                                    set theLinkPath to file path of theLink as alias

                                    tell application "Finder"

                                        set a to name of parent of theLinkPath

                                        set b to name of fname

                                    end tell

                                    if a is not equal to b then

                                        set n to name of theLink

                                        set linklist to linklist & n & return

                                    end if

                                end repeat

                            end tell

                            display dialog "These placed files are not in the selected folder:" & return & linklist

                        end tell

                        -------------------------------------

                        • 9. Re: Is there a script/utility to monitor/flag any link outside a specified folder?
                          JointyJr Level 2

                          That worked!

                           

                          But,

                           

                          I found that if the file has a QR coded generated within the file you get:

                          Screen Shot 2017-03-20 at 12.45.53.png

                          and if there's am embedded image this happens:

                          Screen Shot 2017-03-20 at 12.47.28.png

                           

                          But having said that it's very rare that we use QR Codes - or - embed images! It was just coincidence that the first 2 files had them

                           

                          Thanks rob, I'll send this round the studio for a test!

                          • 10. Re: Is there a script/utility to monitor/flag any link outside a specified folder?
                            rob day Adobe Community Professional & MVP

                            Try this:

                             

                            -----------------------------------------

                            tell application "Adobe InDesign CC 2017"

                                set fname to choose folder with prompt "Select a destination folder"

                                set linklist to ""

                                tell active document

                                    repeat with theLink in every link

                                        try

                                            set theLinkPath to file path of theLink as alias

                                            tell application "Finder"

                                                set a to name of parent of theLinkPath

                                                set b to name of fname

                                            end tell

                                        on error

                                            set a to ""

                                        end try

                                        if a is not equal to b then

                                            set n to name of theLink

                                            set linklist to linklist & n & return

                                        end if

                                    end repeat

                                end tell

                                if linklist is not "" then

                                    display dialog "These placed files are not in the selected folder:" & return & linklist

                                else

                                    display dialog "All links are in the selected folder"

                                end if

                            end tell

                            -----------------------------------------