10 Replies Latest reply on Nov 30, 2015 7:07 AM by Peter Spier

    After File/Package. 441 Missing Links.  Best way to fix?

    malch Level 1

      Hi there,

      Was told by my printer that my packaged InDesign file has 441 Missing Links.  It all seems to have to do with the fact that I used apostrophes (which I'm now calling catastrophes) to name my best photos, the ones I ended up using. In other words, if I took 25 photos of Teriyaki Chicken on a cutting board (my book is a cookbook), then I'd add an apostrophe to the beginning of the name of the photo I liked the best, to differentiate it from the 24 others. Naming it like this also made it first in the list of photos, which was nice. 

      Anyway, worked fine for me (No Errors) in InDesign, but when I packaged my book and sent it to the printer he emailed back to say that 441 Links are missing and it's because of these apostrophes.

      So... what's my best modus operandi?  The printer sent me the InDesign Preflight Report that itemizes all the missing files, but where and how do I start to fix them all?  If I go the the first missing-link photo on page six, for example, there's no simple, elegant way to right-click on it to then fix it.  So first, do I need to go into Finder and re-name every photo that has an apostrophe in the title, and then re-link to it in the Preflight panel?

      I have to fix 441 of these things, so I thought I'd ask about the best way of doing things before starting!

      Thanks,

      Malcolm

        • 1. Re: After File/Package. 441 Missing Links.  Best way to fix?
          Peter Spier Most Valuable Participant (Moderator)

          Basically, you need to rename all the files, then relink in the Links panel before re-packaging.

          • 2. Re: After File/Package. 441 Missing Links.  Best way to fix?
            malch Level 1

            Hi Peter,

            Thanks for your note.  A couple of follow-up questions before I proceed. 

            1. I'm wondering if there's an easy way for me to locate some of these improperly named photos.  For example, on page six, I've got a photo that needs to be re-linked, but I have no idea where it is (I have a few hundred folders in my InDesign project folder where I tried to keep things organized, but inevitably some things that didn't fall into an obvious category ended up in a mixed-bag folder).  Is there a way to get InDesign to tell me where the original source file is?  If my InDesign Preflight panel recognized these 'apostrophed' source files as a problem, then I think I could more easily track them down.  But my Preflight panel is perfectly fine with my naming system.  It's only the post-package Preflight Report that highlights all of these problems.

            2. when I go about renaming these photos, can I put a blank at the beginning of each name (so that the photo appears at the top of the list), or will this also contravene the Package/Pre-flight protocol?

            Regards, Malcolm

            • 3. Re: After File/Package. 441 Missing Links.  Best way to fix?
              BobLevine MVP & Adobe Community Professional

              They easiest way for this project is to export a PDF and send that.

              • 4. Re: After File/Package. 441 Missing Links.  Best way to fix?
                Kasyan Servetsky Level 5

                Here I made a quick and dirty script which replaces apostrophes with underscores (so that the file names appeared at top).

                Before

                After1.jpg

                2.jpg

                 

                var scriptName = "Remove apostrophes in links",
                doc;
                
                PreCheck();
                
                //===================================== FUNCTIONS ======================================
                function Main() {
                    var link, newName, file, newFile, renamed, oldLinkName,
                    links = doc.links,
                    count = 0;
                   
                    for (var i = links.length - 1; i >= 0; i--) {
                        link = links[i];
                        oldLinkName = link.name;
                        if (oldLinkName.match(/^'/) != null) {
                            newName = oldLinkName.replace(/^'/, "_");
                            file = new File(link.filePath);
                            renamed = file.rename(newName);
                            if (renamed) {
                                newFile = new File(link.filePath.replace(/'/, "_"));
                                if (newFile.exists) {
                                    link.relink(newFile);
                                    count++;
                                }
                            }
                        }
                    }
                   
                    var report = count + " link" + ((count == 1) ? " was" : "s were") + " renamed.";
                    alert("Finished. " + report, scriptName);
                }
                //--------------------------------------------------------------------------------------------------------------------------------------------------------
                function PreCheck() {
                    if (app.documents.length == 0) ErrorExit("Please open a document and try again.", true);
                    doc = app.activeDocument;
                    if (doc.converted) ErrorExit("The current document has been modified by being converted from older version of InDesign. Please save the document and try again.", true);
                    if (!doc.saved) ErrorExit("The current document has not been saved since it was created. Please save the document and try again.", true);
                    Main();
                }
                //--------------------------------------------------------------------------------------------------------------------------------------------------------
                function ErrorExit(error, icon) {
                    alert(error, scriptName, icon);
                    exit();
                }
                //--------------------------------------------------------------------------------------------------------------------------------------------------------
                
                
                • 5. Re: After File/Package. 441 Missing Links.  Best way to fix?
                  Peter Spier Most Valuable Participant (Moderator)

                  Another way to deal with this (but the script is probably faster) would be to work from the ORIGINAL file, not the packaged one. Use the copy links command from the panel flyout menu to put all the links into one folder, then the relink to folder command to relink to the copies. No you can go through that folder and rename files and when it's time to relink you'll have no trouble finding them.

                  • 6. Re: After File/Package. 441 Missing Links.  Best way to fix?
                    malch Level 1

                    Kasyan and Peter, thank you for your help.  Sorry about my delay in getting back to you—had to leave town for the weekend.  Amazing script that you created Kasyan, but I was afraid that maybe the packaging process wouldn't like underscores, so, at risk of carpal tunnel, I've ended up going through all my original files hunting down and getting rid of all the apostrophes.  Then the labourious task of re-linking all my unlinked files.

                    Think I'm finally finished.  The long, hard way of doing it, maybe, but I'm now a bit paranoid about this process.  Why, I wonder, didn't InDesign tell me before packaging, that it had a problem with apostrophes?

                    Oh well.  Now I know.  I notice I assigned numbers to some of my photos (say I had eight photos of a dish, numbering them was the best way to keep them organized)—I hope there's not a problem with numbers.

                    If there is, at least I'll know how to fix it.

                    Anyway, all to say, I appreciate the advice and guidance, as always.

                    Malcolm

                    • 7. Re: After File/Package. 441 Missing Links.  Best way to fix?
                      Peter Spier Most Valuable Participant (Moderator)

                      Sorry to hear you didn't use the script. Undercores and hyphens are OK in file names.

                      • 9. Re: After File/Package. 441 Missing Links.  Best way to fix?
                        Kasyan Servetsky Level 5

                        To be on a safe side you could have made another package -- e.g. on another local/network/flash/etc. drive -- and run the script against the copy.

                         

                        If you don't want underscores, you can replace them with empty strings, like so:

                        newName = oldLinkName.replace(/^'/, "");
                        
                        
                         newFile = new File(link.filePath.replace(/'/, ""));
                        
                        

                        This will remove the apostrophes. Alternatively, you can use another character.

                         

                        Sure, numbers are OK for file names.

                        • 10. Re: After File/Package. 441 Missing Links.  Best way to fix?
                          Peter Spier Most Valuable Participant (Moderator)

                          All alphanumeric ASCII characters along with underscore and hyphen are safe. Accented characters tend to be iffy.