1 Reply Latest reply on Apr 8, 2014 12:28 AM by cramik

    How to move footnote-text up one footnote for all footnotes following a given number?

    cramik

      I've got a text with hundreds of footnotes. After having done lots of corrections in indesign i found that footnote-reference 400 was missing (dropped by Indesign). The text of the following footnotes was wrong (Indesign lost the reference but kept the text for the following reference). I've inserted a new empty footnote and would like to move every following footnote (text, not reference) up by one note.

       

      This is how far I got (with a little help from someone elses post on this forum):

       

      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, "Empty startnote:");

      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=noteStart; i< myNotes.length; i++) {

                myStory =  app.selection[0].parent;

                myNotes = myStory.footnotes;

                myStory.characters[myNotes[i].storyOffset.index].move(LocationOptions.before, myNotes[i-1].storyOffset);

                }

      }

      else

      exit ();

      }