I know it is the issue of using doc object, but i am so confused about how.
This function is not executing, it stops at "this.getPageNthWords" because "this.xxxxx" is not at document level object, but how can it make is work, please help.
var myAirplanefunc = app.trustedFunction(function()
{
app.beginPriv();
var apWord, apWord2, apnumWords;
var myactivedoc = app.activeDocs;
apnumWords = myactivedoc.getPageNumWords(1);
// also tryed
// apnumWords = this.getPageNumWords(1);
for (var z = 0; z < apnumWords; z++)
{
apWord = this.getPageNthWord(1,z);
apWord2 = this.getPageNthWord(1,z+1);
if (apWord == "Model")
{
if (apWord2 == "xxx" || apWord2 == "xxw")
{
var myairplane = apWord2;
app.alert("The airplane is " + myairplane)
}
}
}
app.endPriv();
});
var myapeff = app.trustedFunction(function()
{
app.beginPriv();
var myeff, effWord, effWord2, effWord3, effnumWords;
for (var i = 0; i < this.numPages; i++)
{
effnumWords = this.getPageNumWords(i);
for (var j = 0; j < effnumWords; j++)
{
effWord = this.getPageNthWord(i,j);
effWord2 = this.getPageNthWord(i,j+1);
effWord3 = this.getPageNthWord(i,j+2);
if (effWord == "Applicability")
{
if (effWord2 == "Effectivity")
{
myeff = effWord3;
app.alert("Your Effectivity is :- " + myeff);
}
}
}
}
app.endPriv();
});
var myAirplanefunctest = app.trustedFunction(function()
{
myAirplanefunc();
myapeff();
});
// Add Menu Item
app.addMenuItem({cName:"AMM Linker",cParent:"Tools",cExec:"myAirplanefunctest()"});
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com