Prompt Details
Model
Completion - GPT-3.5 (text-davinci-003)
Token size
111 ($0.00220 / call)
Example input
Create a script that creates a null layer above every selected layer.
Example output
{
// Get the active comp
comp = app.project.activeItem;
// Make sure the active item is a Comp
if (!comp || !(comp instanceof CompItem)) {
alert("Please select a composition first!");
} else {
// Get all selected layers
layers = comp.selectedLayers;
// Iterate through all selected layers
for (var i = 0; i < layers.length; i++) {
// Create a null layer
var nullLayer = comp.layers.addNull();
nullLayer.name = layers[i].name + "_null";
// Position the null layer above the current layer
nullLayer.moveBefore(layers[i]);
}
}
}