-
Loop missing last iteration
I’m trying to store file paths in a single array and code works fine except it misses the last iteration every time. Index seems right to me. Is there something wrong?
var myProj = app.project;var myAssetspath = [];
for (var i = 1; i < myProj.numItems; i++) {
var filesPath = app.project.item(i).file.fsName.replace(app.project.item(i).file.name, "").toString();
myAssetspath.push(filesPath);
}alert(myAssetspath);