2 Replies Latest reply on May 23, 2016 2:11 AM by JonasVans

    How can i move mismatched footnote text


      I have a document with 900 pages and 2700 footnotes (imported from word). After a day of applying styles etc. i noticed there was a problem with some of the footnotes. The text from a footnote was added at the end of the previous footnote text. From that point forward, the footnote text doesn't match the reference number. It is off by one.


      How can i fix this?


      This same problem was addressed here: Re: How to move footnote-text up one footnote for all footnotes following a given number?

      But i'm not familiar with scripting, so i haven't figured out how to apply this...

        • 1. Re: How can i move mismatched footnote text
          [Jongware] Most Valuable Participant

          cramik's script works excellent, but it copies notes backwards. You want to copy them forwards, starting from the 'doubled up' note.

          Here is a complete, adjusted version:


          //DESCRIPTION:Move footnotes FORWARDS into place
          // based on cramik 8-Apr-2014
          // https://forums.adobe.com/message/6280047

          var myStory =  app.selection[0].parent;
          var myName = myInput ();

          // rest of the script
          function myInput ()
          var myWindow =new Window ("dialog", "Form");
          var myInputGroup = myWindow.add ("group");
          myInputGroup.add ("statictext", undefined, "First note to correct:");
          var myText = myInputGroup.add ("edittext", undefined, "");
          myText.characters = 5;
          myText.active =true;
          var myButtonGroup = myWindow.add ("group");
          myButtonGroup.alignment ="right";
          myButtonGroup.add ("button", undefined, "OK");
          myButtonGroup.add ("button", undefined, "Cancel");

          if(myWindow.show ()== 1)
            var noteStart = myText.text;
            var myNotes = myStory.footnotes;

            for (i=myNotes.length-1; i>=noteStart; i--)
            myNotes[i-1].texts[0].move (LocationOptions.BEFORE, myNotes[i].insertionPoints[0]);
          } else
            exit ();


          To save this as a proper script: copy it, paste into the ExtendScript Toolkit Editor (or any other plain code editor), save into your Scripts folder. See http://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-o r-blog-post.php  for the longer version.


          To run this:

          1. click the text cursor inside the running story that contains your footnotes.

          2. double-click the script to start it.

          3. the dialog that pops up asks for the first footnote to move 'forward' from. Enter the footnote number that contains your double text. The script will also move that one in its entirety, so make sure to copy the correct text back to the (now) empty one with which you started.


          Make sure to test on a copy, just in case something goes wrong!

          • 2. Re: How can i move mismatched footnote text
            JonasVans Level 1

            This worked perfectly! Thank you so much for your great response! You saved me a lot of time.