Forum Replies Created
-
Vincenzo Imbimbo
June 9, 2022 at 2:32 pmThanks for your reply Andrei, unfortunately my script keeps having the same bug, I was hoping I wouldn’t have to rebuild everything from scratch but I’ll take a look at that ScriptUI Dialog Builder, thank you!!
-
Vincenzo Imbimbo
May 31, 2022 at 9:45 amI figured it out with this:
var durationIn = myLayers[i].Effects("ADBE Slider Control")
? myLayers[i].Effects("ADBE Slider Control")
: myLayers[i].Effects.addProperty("ADBE Slider Control");
durationIn.name = "IN";
var durationOut = myLayers[i].Effects("ADBE Slider Control")
? myLayers[i].Effects("ADBE Slider Control")
: myLayers[i].Effects.addProperty("ADBE Slider Control");
durationOut.name = "OUT";
But the problem is that the ternary operator just read if the layer has a “Slider Control” and i need it to be specific with “IN” and “OUT” sliders. Sorry for asking so much questions, i’m really newbie with JS.
-
Vincenzo Imbimbo
May 31, 2022 at 9:06 amIs there any way to apply the same Ternary Operator to this line of code?
var durationIn = myLayers[i].Effects.addProperty(“ADBE Slider Control”);
durationIn.name = “IN”;
I want to add to each selected layer a slider control named “IN” but if i run the script again i don’t want to add another slider control named “IN”, i just want to overwrite the value of that slider with a new input. Can you help me? Thanks again!
-
Vincenzo Imbimbo
May 31, 2022 at 8:57 amOh nevermind, it was the “;” that i was keeping at the end of “var myTrim…” so the ternary operator was missing the condition, but now is working perfectly, thank you so much!!
-
Vincenzo Imbimbo
May 31, 2022 at 8:40 amHi again Andrei, thank you for your reply, i tried the code but i’m getting a syntax error saying that “?” doesn’t have an assigned value. What i am missing?
-
Vincenzo Imbimbo
May 27, 2022 at 3:46 pmThank you Andrei!! This is what i need it, but there’s a little problem, if i execute the script again it will add another Trim Paths to each selected layer, i just want to have 1 Trim Path, no matter how many times i execute the script, any way to fix this? Something like “if this shape layer already has a trim path then don’t add a trim paths”, thank you!
-
Vincenzo Imbimbo
May 26, 2022 at 3:46 pmThank you Dan, it works perfectly!
-
Vincenzo Imbimbo
May 25, 2022 at 7:28 pmThis was exactly what i needed, thank you so much Dan!!
-
Vincenzo Imbimbo
March 28, 2022 at 4:43 pmThank you so much Dan! This is exactly what i needed, you are such a pro!
-
Vincenzo Imbimbo
January 31, 2022 at 5:37 pmI make it work but only for 1 shape element of each shape layer, i want it to work in any shape layer no matter how much elements it has inside the Groups.
This is what it works:
var project = app.project;
var comp = project.activeItem;
app.beginUndoGroup("Process");
var myLayers = comp.selectedLayers;
for (var i = 0; i < myLayers.length; i++){
var myContents = myLayers[i].property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Graphic - Stroke").property("ADBE Vector Stroke Line Cap").setValue(2);
}
app.endUndoGroup();
And this is what i’m doing trying to work through all the properties (i want it to work in any scenario):
var project = app.project;
var comp = project.activeItem;
app.beginUndoGroup("Process");
var myLayers = comp.selectedLayers;
for (var i = 0; i < myLayers.length; i++){
var myContents = myLayers[i].property("ADBE Root Vectors Group");
for (var j = 1; j <= myContents.numProperties; j++){
myContents.property(j).property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Graphic - Stroke").property("ADBE Vector Stroke Line Cap").setValue(2);
}
}
app.endUndoGroup();