Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Sharing Knowledge

$
0
0

Hi All,

 

Use below function for avoid Unique or duplicate in arrays:

 

myTextFile2.write( "Ligatures Missing\t" + unique(myParaPageArray) + "\n")

function unique(myPs) {
    var newArray = new Array();    label: for (var i = 0; i < myPs.length; i++) {        for (var j = 0; j < newArray.length; j++) {            if (newArray[j] == myPs[i]) continue label;        }        newArray[newArray.length] = myPs[i];    }    return newArray;
}

 

Please share this kind of functions. Surely helpful for lot of programmers.

 

Regards

Siraj


Viewing all articles
Browse latest Browse all 15932

Trending Articles