Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Add a custom solid to a selected comp in the project panel

$
0
0

Hi

 

I cant figure this one out. I really am the phase of learning the wonderfull world of after effect scripting.

 

I am trying to do a script where i add a custom solid to a selected comp in the project panel. Also do a check to see if a comp is selected.

 

Here below is my poor attempt.

 

app.beginUndoGroup("Add solid");

 

var curItem = app.project.activeItems;

 

//Check if is a comp is selected

if(curItem == null || !(curItem instanceof CompItem)) {

      alert("Please select a comp");

 

}else{

 

alert("You have selected a comp");

 

curItem.items.addSolid([0.5,0.5,0.5], "My Gray Solid", 1920, 1080, 1.0, 5);

 

}

app.endUndoGroup();




Please advice...

 

/HRB


Viewing all articles
Browse latest Browse all 2143

Trending Articles