Dear Scriptographer team,
I am trying to use an existing script I have downloaded which calculates the area of the object (http://www.IllustrationETC.com/AIbuds/JET_GetInfoScripts.zip) and I put the .js file in the Scriptographer Scripts folder but it doesn't work, instead it says this:
“TypeError: Cannot read property "length" from undefined
at Scriptographer Scripts/JET_GetArea.js:1”
Could you please take a look at it and tell me how to fix the problem. This is the code of the script.
if ( app.documents.length > 0 && app.activeDocument.selection.length > 0 ) {
var docRef=app.activeDocument;
var pathRef=docRef.selection[0];
var pathRefArea=pathRef.area;
alert ("Square Points: "+Math.round(pathRefArea*100)/100+"\n"
+"Square Picas: "+(Math.round((pathRefArea/144)*100))/100+"\n"
+"Square Inches: "+(Math.round((pathRefArea/5184)*100))/100+"\n"
+"Square Millimeters: "+(Math.round((pathRefArea/8.037)*100))/100+"\n"
+"Square Centimeters: "+(Math.round((pathRefArea/803.520)*100))/100);
}
Thank you in advance, kind regards,
Filip Pomykalo