2 Replies Latest reply on Jan 23, 2011 8:35 AM by Chang_indd

    Em dash with hyphenate word

    Chang_indd Level 1

      Hi All,

       

      Is it possible to find hyphenate word with em dash and en dash at the end of the line?

       

      Please provide the code.

       

      see example below:

      Untitled-1.jpg

       

      Thanks,

      Chang

        • 1. Re: Em dash with hyphenate word
          Mi_D Level 3

          Dear Chang,

           

          for em dash with hyphenate word try this code

           

          app.findChangeGrepOptions.includeFootnotes = true;

          app.findGrepPreferences = null;

          app.findGrepPreferences.findWhat = "\\—(.*?)-" ;

           

          var myFound = app.activeDocument.findGrep();

          try{

          for (var i = 0; i < myFound.length; i++)

          {

           

          if(app.selection[0].words[-1].lines[0]){

           

          }

           

          }

          alert("number of word found:" + [1+i])}

          catch(e){}

           

          Mi_D

          1 person found this helpful
          • 2. Re: Em dash with hyphenate word
            Chang_indd Level 1

            Thanks for your reply.

             

            It searches between paragraphs too. I don't want to search between paragraphs.

             

            Need to chek at the end of line only.

             

            Chang.