-
1. Re: JS CS3 flag duplicate images with scale and rotation differnce
John.Kordas Dec 16, 2010 6:31 PM (in response to John.Kordas)I think I might be one step closer to getting this to work. I've been able to just capture the file path of the duplicates using:
//count the number of times the link is used
function LinkUsage(myLink) {
var myLinkCounter = 0;
for (var myCounter = 0; myCounter < myDoc.links.length; myCounter++) {
if (myLink.filePath == myDoc.links[myCounter].filePath) {
myLinkCounter++;
}
}
return myLinkCounter
}//check if the filepath has been added to the array
function chkVal(val){
var compCount = 0;
for(var arr = 0; arr < myNumLinks.length; arr++){
if(val == myNumLinks[arr] ){
compCount++;
}
}
if(compCount >=1){
return false;
}else{
return true;
}
}
//check the links inthe doc
var myDoc = app.activeDocument;
var myNumLinks = [];
for ( var t = myDoc.links.length-1; t >= 0; t-- ){
if(LinkUsage(myDoc.links[t])>1){
if(myNumLinks == 0){
myNumLinks.push(myDoc.links[t].filePath);
}else{
if(chkVal(myDoc.links[t].filePath)){
myNumLinks.push(myDoc.links[t].filePath);
}
}
}
}
for (var i=0 ; i <myNumLinks.length; i++){
$.write(myNumLinks[i]+"\n");
}

