Skip to main content
BEGINNER_X
Legend
April 1, 2014
Question

Find Hard hyphen with Dynamic Spelling

  • April 1, 2014
  • 1 reply
  • 700 views

Hi All,

Is it Possible?

1. Using Script ON the Edit ---- spelling ----- Dynamic Spelling

2. So obviously, the misspelling word is underline by red line

3. Script need to find the underline(misspelling word) with the manual hyphen word at the end of line

4. Just alert the content with page number

(Dictionary: English USA)

For example:

Need to find the first line of ques- is the manual hyphen

No need to find the second line without the red line

Kindly give some solution for my request.

Thanks

Beginner_X

This topic has been closed for replies.

1 reply

Trevor:
Legend
April 2, 2014

This what your looking for?

var doc = app.activeDocument;

app.changeGrepPreferences = app.findGrepPreferences = null;

app.findGrepPreferences.findWhat = "\\w+[-~=~-~_]";

var myFinds = doc.stories.everyItem().lines.everyItem().words[-1].findGrep();

myFinds = myFinds.concat.apply([],myFinds);

var l = myFinds.length, pp;

while (l--) myFinds = myFinds.words[0].contents + ((pp = myFinds.parentTextFrames[0].properties.parentPage) ? "\tPage Name: " + pp.name + "\tPage offset: " + pp.documentOffset : "\tWord off the page");

alert (myFinds.join("\r"));

BEGINNER_X
Legend
April 2, 2014

Hi Trevor,

First, thanks for your response....

Your script is finding all the manual hyphenation between the words.

But my request, is it possible to find the hard (or manual) hyphenate  word with enable dynamic spelling(red line for misspelled words) only.

Thanks

Beginner_X

Trevor:
Legend
April 2, 2014

Hi

I don't really know what you mean by hard or maual hyphens if you mean a plain minus sign - hypen then just change the grep to

= \\w+\-

Regarding spelling you can only script it if you pay for Mindsteam spell check pro (google it) or write your own C++ plug-in and use the kspelling properties.

Good luck