Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Add something to a selected group of a shapelayer

  • Add something to a selected group of a shapelayer

    Posted by Fabian Brugger on May 8, 2023 at 12:58 pm

    Hallo, so i want to add something, for example a trim path effekt, to a shapelayer. That works with the script below but how could i change the script so it will put the effekt on a the selected group of the shapelayer?

    var comp = app.project.activeItem;

    var layers = comp.selectedLayers;

    for (var i = 0; i < layers.length; i++) {

    if (layers[i] instanceof ShapeLayer) {

    var propertyOne = layers[i].property(“ADBE Root Vectors Group”);

    propertyOne.addProperty(“ADBE Vector Filter – Trim”);

    }

    }


    There is the code: selectedProperties, but i dont know how to implement this into my script.

    Fabian Brugger replied 3 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 8, 2023 at 4:37 pm

    Try this:

    var comp = app.project.activeItem;
    var props = comp.selectedProperties;
    for (var i = 0; i < props.length; i++) {
    if (props[i].matchName == "ADBE Vector Group"){
    props[i].property("ADBE Vectors Group").addProperty("ADBE Vector Filter - Trim");
    }
    }
  • Fabian Brugger

    May 9, 2023 at 8:11 am

    Thank you Dan!

    I almost had the same but i mistakenly left the Line:
    if (layers[i] instanceof ShapeLayer) {
    in the same place and i think it broke the code as a property cant is obviously not a shapelayer 🙂

    Thanks!

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