ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Tab delimited files to Comp Marker

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
AD Narayan
Tab delimited files to Comp Marker
on Nov 27, 2018 at 9:28:51 pm

Hey guys,

Attempting to create a script that grabs info from a Tab Delimited File and create comp markers.

I've got the bones of my script working, however I'm not sure how to select which "column" or "tab" of the delimited file to grab for info.

I need it to grab information from column 2, add it to a variable called TC, then grab information from column 4, and add it to a variable called comm.

And do this until end of file essentially.

My loop looks something like this:

var tc;
var comm;
while (!tdlFile.eof){
tc = tdlFile.readln(); // Not sure if this right to read tc? Column 2
comm = tdlFile.readIn(); // Not sure if this is right to read comment? Column 4
if (tc == "") tc = 1 ; // if tc is blank, then change tc to 1 second
myComp.markerProperty.setValueAtTime(tc, comm) // unsure if this is actually how to add a comp marker.
}


Lead VFX and Motion Design at Tomorrowland NZ


Return to posts index

Dan Ebberts
Re: Tab delimited files to Comp Marker
on Nov 27, 2018 at 10:11:23 pm

I'm sure this isn't exactly right, but it will be something like this:


var myMarkerVal = new MarkerValue("");
var myLine;
var tabChar = String.fromCharCode(9);
var mySplitLine;
var temp;
var tc;

while (!tdlFile.eof){
myLine = tdlFile.readln();
mySplitLine = myLine.split(tabChar);
temp = mySplitLine[1];
tc = (temp == "" ? 1 : parseFloat(temp));
myMarkerVal.comment = mySplitLine[3];
myComp.markerProperty.setValueAtTime(tc, myMarkerVal);
}



Dan



Return to posts index

AD Narayan
Re: Tab delimited files to Comp Marker
on Nov 27, 2018 at 11:36:31 pm

Thank you so much! So close!

I've tweaked it and the only error I'm getting at the moment is that the tc variable is NaN, because of course it is in HH:MM:SS:FF. So need to do a timestamp to frames conversion before calling it.

Lead VFX and Motion Design at Tomorrowland NZ


Return to posts index

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