this.getPageNthWord using space or carriage return between words
i have script loops total of 8 words.
the fourth word can separated space in instances or carriage return (paragraph mark) in other instances.
the script not working, if can modify highlighted part of script the or operator that appreciated.
numwords = this.getpagenumwords(0);
for (var j = 0; j < numwords-1; j++)
{
ckwords8 = this.getpagenthword(0, j) + ' ' + this.getpagenthword(0, j + 1) + ' ' + this.getpagenthword(0, j + 2) + ' ' + this.getpagenthword(0, j + 3) + '\n' || ' ' + this.getpagenthword(0, j + 4) + ' ' + this.getpagenthword(0, j + 5) + ' ' + this.getpagenthword(0, j + 6) + ' ' + this.getpagenthword(0, j + 7);
you can include or operator inside of condition. has no meaning in context used it.
so combine words ckwords8 , @ end use this:
if (ckwords8=="phrase 1" || ckwords8=="phrase 2") { ... }
More discussions in JavaScript
adobe
Comments
Post a Comment