I'm working on a script that executes a menue command to make editable text from my PSD file.
this is my code so far:
Code: Select all
main();
// here it happens
function main(){
// get the current active composition
var curComp = app.project.activeItem;
// if ther is no comp
if (!curComp || !(curComp instanceof CompItem))
{
// alert and end the script
alert("Please select a Composition.");
return;
}
// start undogroup
app.beginUndoGroup("main");
for (var i = 0; i < curComp.selectedLayers.length; i++)
{
//layers.push(sellayers[i]);
var l = curComp.selectedLayers[i];
var tl = l.source.layers[1];
tl.selected = true;
app.executeCommand(app.findMenuCommandId("In editierbaren Text umwandeln"));
}
//end undogroup
app.endUndoGroup();
}
Code: Select all
app.executeCommand(app.findMenuCommandId("In editierbaren Text umwandeln"));
When i open the comps the first layer (which is the text layer) is selected but not converted.
Where is my mistake?
Do I have to bring the comp to the front or something like this?
And if so, how do I do that?
Best :fabian