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

Popular posts from this blog

How to permanently disable the right side bar in iOS 10.1.1 to keep from inadvertently opening Acrobat all the time

Photoshop CC 2017 - Ruler Tool - Error 8007...

Inserting hyperlinks into a 3D .pdf