-
Add Trim Paths to any selected shape layers with a Script
Hello guys, anyone can help me to add a Trim Paths to any selected shape layers? I just want to add ONE trim paths to each layer, no matter how many shapes it has inside.
Any help?
This is the property path to the Trim Paths:
layers[i].property(“ADBE Root Vectors Group”).property(“ADBE Vector Filter – Trim”)I also want to access the “Start” and “End” of the trim paths to add an expression to each one.
This is the property path for “Start”:
layers[i].property(“ADBE Root Vectors Group”).property(“ADBE Vector Filter – Trim”).property(“ADBE Vector Trim Start”)
And this is the property path for “End”:
layers[i].property(“ADBE Root Vectors Group”).property(“ADBE Vector Filter – Trim”).property(“ADBE Vector Trim End”)
I think the code should be something like this:
var comp = app.project.activeItem;
var layers = comp.selectedLayers;
if(layers.length == 0){
alert("You must select a layer");
} else {
for(var i = 0; i < layers.length; i++){
layers[i].property("ADBE Root Vectors Group").//add??//property("ADBE Vector Filter - Trim")
//and then://
layers[i].property("ADBE Root Vectors Group").property("ADBE Vector Filter - Trim").property("ADBE Vector Trim Start").//expression = "my expression"??//