Creative Communities of the World Forums

The peer to peer support community for media production professionals.

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 am

    Hi,

    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

  • Chris Voelz

    January 30, 2023 at 9:39 pm
  • Walter Soyka

    January 30, 2023 at 10:00 pm

    Chris 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.

Viewing 1 - 3 of 3 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy