Skip to main content
asz123123
Participant
September 24, 2015
Question

Is it possible to call a hotkey command from script?

  • September 24, 2015
  • 2 replies
  • 637 views

There are a handful of commands I'd like to access from script, however, there don't seem to be any ways to do so.

For example, I would like to trigger the Timeline command to "Scroll topmost selected layer to top of Timeline panel", which is by default bound to "X"

This command is not present in any menu item, so doing app.executeCommand(app.findMenuCommandId("Name of command...")); so this method does not appear to be viable.

Any thoughts?

This topic has been closed for replies.

2 replies

Inspiring
October 2, 2015

You could always write a function to do move the selected layer to the top (or up one layer) quite easily.

asz123123
asz123123Author
Participant
October 2, 2015

you could do that if you were willing to change the structure of the composition, which I'm not. Plus, that could create lots of issues with layering, track mattes, etc..

Although, separately, I can access the 'shy' property for layers to hide them...

Legend
September 24, 2015

I believe there are some hotkeys like "CompScrollSelectedLayerToTop" that are internal to the App and there is no way to trigger that via ExtendScript. You can customize and change the key in the shortcuts pref document. There maybe SDK access via a plugin, but I am not sure on that.

asz123123
asz123123Author
Participant
September 30, 2015

Thanks for the reply, David.

It seems that the SDK has a similar limitation. After a quick skim through the CC 2014 SDK, they call out the same functionality we have in script (p184):

if your AEGP needs to call an After Effects menu item, you can use the scripting command:cmd = app.findMenuCommandId(text);or contact API Engineering for the command number.

It doesn't seem like there is much surface exposing the UI to script or plugins... oh well.