Quantcast
Channel: Adobe Community : Unanswered Discussions - Acrobat
Viewing all articles
Browse latest Browse all 73766

Weird acrojs problem!

$
0
0

Hi Guys!

 

I made this simple spell check script last week so that I could spell check some documents properly but while tinkering with it yesterday, I accidently introduced an error in it. Now, whenever I execute it, the thermometer shows up but does not progress. If I press the button again, the thermometer starts progressing and the script executes but then the thermometer does not close. It was working perfectly earlier and I cannot locate the source of this error. The code is almost the same as before to my eyes. I've been trying for hours to fix this issue but without success. The code is as below:

 

---------------------------------------------------------------

app.addToolButton({cName: "Spell Check", cExec: "spellcheck();", cTooltext: "Spell Check", nPos: 0 });

function spellcheck()

var numWords, ckWord;

var t = app.thermometer;

t.duration = this.numPages;

t.begin();

        for (var i = 0; i < this.numPages; i++ )

        { 

            numWords = this.getPageNumWords(i);

            t.value = i;

            t.text = "Processing page " + (i+1) + " of " + (this.numPages);   

            for (var j = 0; j < numWords; j++)

            {

                ckWord = spell.checkWord(this.getPageNthWord(i,j));

                    if (ckWord != null)

                        { this.addAnnot({ page: i, type: "Squiggly", quads: this.getPageNthWordQuads(i,j), author: "script", contents: this.getPageNthWord(i,j) + ": " + ckWord.toString() });}   

            }   

                if (t.cancelled){ break;}

        }

t.end();

  app.alert ("Spell check done.",3);

--------------------------------------------------------------

 

I really need to make it work properly again. Any help would be much appreciated!

 

I also needed to know as to how do I force the use of a specific dictionary for this spell check. It currently uses all the available dictionaries even when I am passing a subset of spell.dictionaryNames to the spell.checkWord method. The acrobat object reference guide mentions that we also have the following dictionaries available in acrobat :

 

English USA Medical

English USA Legal

English USA Sci/Tech

English USA Geo/Bio

 

Could any one point me as to where to find these dictionaries as they are not installed in the default package.Only English USA is there.

 

I am using Acrobat 9 pro and X pro.


Viewing all articles
Browse latest Browse all 73766

Trending Articles