Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects script to source text data into a text file

  • script to source text data into a text file

    Posted by Aronduby on September 2, 2006 at 2:47 pm

    Alright all you scripting geniouses out there, I got one for ya. I have two layers of text, and what I need is a script that will run through the comp and put the value of the source text of each layer into a seperate array into a text file.

    To clear up any confusion, what I’d be doing is rendering out my comp from AFX, and converting it to an FLV and then including the text file of arrays and using that to add cuepoints in actionscript. That way I don’t have to keep writing down the data from afx and then hand coding them into actionscript. So the text file would be written in actionscript and would look like:

    var time_array:Array = new Array(comma seperated list of source text from layer named time);
    var arg_array:Array = new Array(comma seperated list of source text from layer named arg);

    I’m convinced that this is doable, but have already crashed AFX two or three times in my sad attempts.

    Thanks for your help, Aron Duby

    Aronduby replied 19 years, 8 months ago 10,403 Members · 1 Reply
  • 1 Reply
  • Aronduby

    September 3, 2006 at 11:32 am

    ok, so I figured it out, and figured out a better way to do it, using markers instead of text layers. I would love to get some feedback and ways I could clean this up, because I’m fairly sure I can since its my first script. Alot of it is based off of a script from Lee Brimelow, but I’m still really proud of it.

    {//scope limiter

    //if there’s no layer named cuePoints in the active comp alert the user
    if(app.project.activeItem.layer(“cuePoints”)==null){
    alert(“active comp must contain a layer name cuePoints”);
    }
    else{//if we have the proper layers
    var out = filePutDialog(“Select an Output File”, “cuePointsData.txt”, “txt”);//create a text file

    var cues = app.project.activeItem.layer(“cuePoints”).property(“Marker”);//the markers on the cuePoints layer

    //get the starting and delimiter values from the user
    var start = prompt(“Enter the code that you want to precede the property values:\n\n\tExample: var cues:Array = [“,”var cues:Array = [“);
    var delim = prompt(“Enter the character that will separate the values:”,”,”);

    //open our new file for writing and write the start from the user
    out.open(“w”);
    out.write(start);

    var prevComment = “”;//empty variable, used to keep the same marker from being repeated in the file
    var j = 0;//a counter to tell the loop not to insert the delimiter at the begining

    //loop through activeComp by frames
    for(var i=0;i

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy