Hi,
i recently started scripting and wrote a script for After Effects in VS Studio, which works fine when i launch it from Visual Studio. But as soon as i save it and run the script from After Effect it gives me an error message: "unable to execute at line 20..."
which is a function in my script. everything before gets executed.
I have Variables (a,b) in my function because i am looking for several Objects meaning CompItem, FootageItem, Folderitem where I'm looking for specific names as a string.
It is a script for a specific project so all the files will be found.
The Function looks like that:
"
function graballItems (a,b){
//alert("OK");
var proj,curItem,itemTotal,MyItem;
proj = app.project;
itemTotal = proj.numItems;
for (var i =1; i<= itemTotal; i++){
curItem = proj.item(i);
if (curItem instanceof b && curItem.name.indexOf(a) !== -1 ){
return curItem;
}
}
throw new Error("could not find item!");
}
var myCompBeauty = graballItems("CAN_ENDTAG_PRE",CompItem);
//alert("Beauty Comp ="+ myCompBeauty.name);
"
Strange enough when i have the alert line active the script works but when it commented out it doesn't work.
cheers
Martin