Search code examples
scriptingextendscriptafter-effects

Is it possible to use the After Effects 'Create Shapes from Vector Layer' functionality from within a script (Adobe ExtendScript)?


I am attempting to create a script for Adobe After Effects. Part of what I am attempting to accomplish will require converting layers imported from Illustrator into After Effects shape layers.

I am having trouble finding any info on how this can be accomplished in ExtendScript. Is it possible?


Solution

  • Any menu commands in After effects are available to extendscript, even if they're not included in the API. To invoke a command as you would with a menu you use

    app.executeCommand(1234);
    

    Where 1234 is the number of the command you want. To find this magic number there is a function

    app.findMenuCommandId("Full text of command as it appears in the menu");
    

    It's kludgy, and there's no guarantee that adobe will stay consistent with the numbers between releases, but it's all we have. More details and a list of magic numbers here