Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

extendscript after effects remove specific controls

Explorer ,
Jun 06, 2022 Jun 06, 2022

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
229
Translate
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.

 

 

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
...
Translate
LEGEND ,
Jun 06, 2022 Jun 06, 2022

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

 

Mylenium

Translate
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

remove control name super control on selected layer from effects panel

Translate
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

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;
    }
}
Translate
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

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.

 

 

Translate
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
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();
Translate
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