6 Replies Latest reply on Mar 15, 2011 7:25 AM by John Hawkinson

    How to find Notes in ID CS4 by label

    gopaljay78 Level 1

      Hi,

       

      In in Indesign document,  there are some tags in the format  [[AR artname.ext]].

       

      First I want to find all tags of this format and convert to notes. Below is the script to do that.

       

      //*******************************************************************************
      //~ // CONVERT NOTE TO TEXT
      app.findGrepPreferences.findWhat = "\\[\\[AR (.+?)\\]\\]";
      autotags = app.activeDocument.findGrep();
      for (i=0; i<autotags.length; i++)
      {
          var NoteLabelVal = autotags[i].contents;
          var NOTE = autotags[i].convertToNote();
          NoteLabelVal = NoteLabelVal.replace("]]", "");    // removing rear double square brackets
          NoteLabelVal = NoteLabelVal.replace("[[", "");    // removing front double square brackets
          var temp1 = NoteLabelVal.split(" ");
          var searchLbl = temp1[0]+"_"+temp1[1];
          NOTE.searchLbl = searchID;
      }
      exit();
      //*******************************************************************************

       


      Here in this script, I find the text with the pattern [[AR artname.ext]] and convert it to note. Then I set the lable of the note to "AR_artname.ext".

       

       

       

      At later stage, I want to locate the notes by label value, instead of looping through every notes.

      For example, if the note label is set to AR_ch01art1.tif, then I want to locate this note directly. Is it possible. Please help me on this.

       

       

      Thanks,

      Gopal