There’s a whole host of operations that aren’t currently scriptable in After Effects such as undo / redo, viewport controls, and others, thankfully Command IDs exist as a backup option when all else fails. Command IDs in After Effects scripting are useful for certain operations that can’t be accomplished through the provided API. They essentially mimic the behavior as if the user clicked the button, or triggered the hotkey for that function. Thus, no arguments can be passed to them, and no results are returned. But in some cases, this is the only way to achieve certain workflows.
You can always search for your desired command with:
but this method is pretty tedious unless you know the exact spelling of the command you’re looking for. Also, this method is not reliable across different languages of After Effects, so the best practice is to find your command ID, and then call it directly using the number, not the name.
There’s no official list of Command IDs from Adobe, but I’ve generated the following list from the translation files found in the app package. (see below for more details)
To use a command simply find it’s id number, and execute it with
If you’re interested in generating your own list since results change with new versions coming out, identify one of the translation .dat files, i.e. on Windows it is located in
C:\Program Files\Adobe\Adobe After Effects 2020\Support Files\Dictionaries\es_ES
and identify the MenuID translation section and write a parser that splits the name from the the command ID:
Here’s a parser I wrote, meant to be run in a CEP panel: