ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Loop missing last iteration

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Rodrigo Aben
Loop missing last iteration
on Jul 15, 2020 at 5:13:52 am

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 &lt; myProj.numItems; i++) {
var filesPath = app.project.item(i).file.fsName.replace(app.project.item(i).file.name, "").toString();
myAssetspath.push(filesPath);
}

alert(myAssetspath);


Return to posts index

Filip Vandueren
Re: Loop missing last iteration
on Jul 15, 2020 at 1:32:20 pm

<= myProj.numItems



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]