Forums › Adobe After Effects › How to close a composition via script
-
How to close a composition via script
-
Rob Packer
January 30, 2023 at 9:34 amHi,
I am using AE 2023 and have written a script that sets an output folder and sends a comp to the render queue. What I’d like to do is add some code to close that comp, which is the active comp. From my research it seems there is no close method for app.project.activeItem.
I thought the line
app.executeCommand(app.findMenuCommandId(“Close”));
would work to replicate the relevant keyboard commands, yet nothing happens.Can anyone help with this?
Thanks
Rob
-
Walter Soyka
January 30, 2023 at 10:00 pmChris linked to the solution. Calling the “Close” menu command works on whatever the active panel in the UI is. You have to call .openInViewer() first to make sure the comp’s viewer panel has focus, otherwise the menu command call might close something else.
Log in to reply.