Expressions/Scripts/Presets

Moderator: byronnash

 
scribling
Topic Author
Posts: 143
Joined: Sun May 01, 2005 1:52 pm
Contact:

Select timeline after running script

Thu Feb 27, 2014 12:22 pm

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?
 
lilsmokie
Posts: 10
Joined: Wed May 07, 2008 9:24 am

Re: Select timeline after running script

Thu Mar 13, 2014 10:37 am

Is this what you're after?

app.activeViewer.setActive();
 
scribling
Topic Author
Posts: 143
Joined: Sun May 01, 2005 1:52 pm
Contact:

Re: Select timeline after running script

Fri Apr 04, 2014 12:23 pm

That's close.
That sets the viewer as the active window.
I need to the timeline as the active window, so I can hit enter and rename.

I tried changing "Viewer" to "Timeline" but that does nothing.

Thanks
 
pecollinni
Posts: 5
Joined: Sun Nov 03, 2013 4:00 pm

Re: Select timeline after running script

Sun Apr 13, 2014 3:53 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.

        tmpName = app.project.activeItem.name;   // specify the active composition name
        app.executeCommand(app.findMenuCommandId("Render Queue"));
        app.executeCommand(app.findMenuCommandId("Timeline: " + tmpName));


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 :wink:

Who is online

Users browsing this forum: No registered users and 1 guest