hi!
I’m trying to get it working adding the possibility to convert text to shape as well, so if you select a bunch of vector art + text layers they are all converted together, but I cannot make it work properly, I added this to Dan’s code (changing “myComp.layer(a)” with “myLayer” to fit the rest of the working code.
If I select text layers it works well, but if I select both vector and text, it just does the vector conversion:
if((myLayer instanceof TextLayer)){
app.executeCommand(app.findMenuCommandId("Create Shapes from Text"));
}
any ideas? thanks!
the whole code looks like this:
app.beginUndoGroup("convert");
var myLayers = app.project.activeItem.selectedLayers;
var myLayer;
for (var i = 0; i < myLayers.length; i++){
myLayer = myLayers[i];
if((myLayer instanceof AVLayer) && (myLayer.source instanceof FootageItem) && (myLayer.source.mainSource instanceof FileSource)){
app.executeCommand(app.findMenuCommandId("Create Shapes from Vector Layer"));
}
else if((myLayer instanceof TextLayer)){
app.executeCommand(app.findMenuCommandId("Create Shapes from Text"));
}
}
app.endUndoGroup();