extendscript after effects remove specific controls

Explorer ,
Jun 06, 2022 Jun 06, 2022

Copy link to clipboard

Copied

this code below removes all effects on a selected layer.
I just want to remove specific control by name.

myEffects.property("Super Controller").remove();
myEffects.property("Time").remove();
myEffects.property("Value").remove();

 

 

as you can se i want them removed the value listed above.

 

{
var myComp = app.project.activeItem;
var myEffects;
for (var i = 1; i <= myComp.numLayers; i++){
try{
myEffects = myComp.layer(i).Effects;
for (j = myEffects.numProperties; j > 0; j--){
myEffects.property("Time").remove();
myEffects.property("Value").remove();
myEffects.property("Super Controller").remove();
}
}catch(err){
}
}
}
TOPICS
Expressions , Scripting

Views

58

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Explorer , Jun 06, 2022 Jun 06, 2022

never mind by the time I wait for you to understand post one I have done it. if you looked at the code in the post1 you would have known what the code was trying to do it's short code anyways thanks.

 

 

Likes

Translate

Translate
Explorer , Jun 06, 2022 Jun 06, 2022
var myLayer = app.project.activeItem.layer(1);
var hasEffect = false;

var targetComp = app.project.activeItem.selectedLayers; // Collect the active composition
var selectedLayer = targetComp.selectedLayers; // Collect the selected layers
var layer = comp.selectedLayers[0];
// Identify the target parameter to be deleted
//var targetParam = selectedLayer[0].transform.position; // Target the Position paramter of the first selected layer
//var parameter = targetComp.selectedProperties(0);


functio
...

Likes

Translate

Translate
Adobe Community Professional ,
Jun 06, 2022 Jun 06, 2022

Copy link to clipboard

Copied

And what is you actual question? You have not made clear what you are actually asking or what rthe problem seems to be.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 06, 2022 Jun 06, 2022

Copy link to clipboard

Copied

remove control name super control on selected layer from effects panel

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 06, 2022 Jun 06, 2022

Copy link to clipboard

Copied

this seems to work however it requires me to click till they are all gone rather than removing it all in one go.

 

var myLayer = app.project.activeItem.layer(1);
var hasEffect = false;

for (var i = 1; i <= myLayer.property("Effects").numProperties; i++) {

    
    
    if (myLayer.property("Effects").property(i).matchName == "ADBE AutoColor") {
         myLayer.property("Effects").property(i).remove(); 
      //  alert("It does!");
      //  hasEffect = true;
      //  break;
    }
}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 06, 2022 Jun 06, 2022

Copy link to clipboard

Copied

never mind by the time I wait for you to understand post one I have done it. if you looked at the code in the post1 you would have known what the code was trying to do it's short code anyways thanks.

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 06, 2022 Jun 06, 2022

Copy link to clipboard

Copied

LATEST
var myLayer = app.project.activeItem.layer(1);
var hasEffect = false;

var targetComp = app.project.activeItem.selectedLayers; // Collect the active composition
var selectedLayer = targetComp.selectedLayers; // Collect the selected layers
var layer = comp.selectedLayers[0];
// Identify the target parameter to be deleted
//var targetParam = selectedLayer[0].transform.position; // Target the Position paramter of the first selected layer
//var parameter = targetComp.selectedProperties(0);


function doesithaveit(){
//for (var i = 1; i <= myLayer.property("Effects").numProperties; i++) {
for (var i = 1; i <= layer.property("Effects").numProperties; i++) {
    
    if (layer.property("Effects").property(i).matchName == "ADBE AutoColor") {


       // if (comp.selectedLayers[0] == true){
         layer.property("Effects").property(i).remove(); 
         }
      //  alert("It does!");
      hasEffect = true;
      //  break;
    }
}


if (!hasEffect) {
    doesithaveit();
    //myLayer.property("Effects").addProperty("ADBE AutoColor");
}
doesithaveit();

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines