Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Peter Menich on May 6, 2012 at 12:08 am

    Hey all,

    I’m heavy duty into csv importing scripts, way over my head.

    I’m trying to mod a script by the inimitable Dan Ebberts…

    https://www.motionscript.com/ae-scripting/create-text-layers-from-file.html

    I’m trying to modify this so that I can change things like…

    01_Instead of importing the file and creating a text objects, it creates a null or a light, or a solid.

    02_Instead of naming the new object with all the text from the string, be able to split the string and just use the first ‘value’ or “item’ in the string that delimitated by a ‘,’ in the line.

    03_Take the values form other items and apply them to other properties within the object created.

    The main issue I’m having if finding a way to identify the correct syntax for the properties.

    For instance; if I change..

    while (!myFile.eof){
    name = myFile.readln();
    if (text == “”) text = “\r” ;
    myComp.layers.addText(name);
    }

    to

    while (!myFile.eof){
    name = myFile.readln();
    if (text == “”) text = “\r” ;
    myComp.layers.addLight(name);
    }

    to add a light instead of a text object, I get…

    Unable to execute script at line 50. After Effects error: Unable to call “addLight” because the call requires 2 parameters.

    How do I find out the correct syntax and its associated properties?

    There doesn’t seem to be a way of selecting a property and finding the internal naming structure.

    I hope someone knows the answer out there!

    P

    Dan Ebberts replied 13 years, 12 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    May 6, 2012 at 12:28 am

    Just Google “After Effects Scripting Guide”. The top entry will take you to the pdf for CS3. For changes since CS3, you’ll need to check out Todd Kopriva’s blog. Here’s the link to the CS4 changes:

    https://blogs.adobe.com/toddkopriva/2008/12/after-effects-cs4-scripting-ch.html

    You’ll also want to look at Adobe’s JavaScript Tools guide, which covers file I/O, UI, and a bunch of other stuff. You can get to it from the Help menu of the ExtendScript Toolkit (from AE: File > Scripts > Open Script Editor; then Help > JavaScript Tools Guide).

    Dan

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