Skip to main content
Known Participant
January 21, 2011
Question

Em dash with hyphenate word

  • January 21, 2011
  • 1 reply
  • 541 views

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:

Thanks,

Chang

This topic has been closed for replies.

1 reply

Inspiring
January 22, 2011

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

Known Participant
January 23, 2011

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.