Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions script that make layer a guide layer

  • script that make layer a guide layer

    Posted by Antony Dupsta on January 15, 2016 at 7:48 pm

    I currently have a script I run that creates two solids and applies an effect to each.
    I manually go into the comp and turn each layer to a guide layer.
    Is there a way to modify a preexisting script to turn each layer into a guide layer to avoid the extra step.
    Possibly a line of code I can ad? My scripting is very minimal , just enough to be dangerous 🙂 but I may be able to plug something in there with your help.

    I ran across this in the manual but I am not sure how to apply this of if this is even what I am looking for.

    AVLayer guideLayer attribute
    app.project.item(index).layer(index).guideLayer
    Description
    True if the layer is a guide layer.
    Type
    Boolean; read/write.

    Does this make any since? Any ideas would be appreciated.

    Thanks for your help
    Ant-

    Antony Dupsta replied 10 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 15, 2016 at 8:28 pm

    Like this:

    var myComp = app.project.activeItem;
    var mySolid = myComp.layers.addSolid([1,1,1],”my solid”,100,100,1,myComp.duration);
    mySolid.guideLayer = true;

    Dan

  • Antony Dupsta

    January 15, 2016 at 10:47 pm

    Dan,

    Thanks so much.
    I looked at your script and than figured out what the preexisting script is using for names and was able to really just ad that last line of code to each solid using their specified names.

    So with your help I was able to modify the current script and ad to it using your formula.

    Thanks for the help!
    Perfect!

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