Is it possible to add code to a script to automatically select the timeline window?
I have scripts that run from a toolbar, but after they're run the selection stays on the toolbar. I'd like the selection to be the timeline so I can simply hit enter and rename the layer.
Any ideas?
Thanks
No? Not possible?
Select timeline after running script
Moderator: byronnash
-
- Posts: 6
- Joined: November 3rd, 2013, 4:00 pm
you can do something like this. This will switch focus to the render queue panel first, and then move the focus to the active composition timeline.
you must do 2 things in order for this to work.
first one is to make sure that your render queue panel is always active (tab opened) and it must be in the same frame where your timeline is. this means that you can't undock render queue panel and place it somewhere else, like on second monitor, or something like that. it must be in the same group as other composition panels (tabs) are, or this wont work. I usually leave it on the first place to the left, which is the default when you open ae.
the second thing is that you'll need to specify the active comp name (tmpName) somewhere in the script, before you (your script) switch the panel focus. be careful, because app.project.activeItem can be the current composition timeline opened, or the current item in the project panel selected.
hope it helps
Code: Select all
tmpName = app.project.activeItem.name; // specify the active composition name
app.executeCommand(app.findMenuCommandId("Render Queue"));
app.executeCommand(app.findMenuCommandId("Timeline: " + tmpName));
first one is to make sure that your render queue panel is always active (tab opened) and it must be in the same frame where your timeline is. this means that you can't undock render queue panel and place it somewhere else, like on second monitor, or something like that. it must be in the same group as other composition panels (tabs) are, or this wont work. I usually leave it on the first place to the left, which is the default when you open ae.
the second thing is that you'll need to specify the active comp name (tmpName) somewhere in the script, before you (your script) switch the panel focus. be careful, because app.project.activeItem can be the current composition timeline opened, or the current item in the project panel selected.
hope it helps
