ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

ExtendedScript - Update Layer Marker

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mackie john
ExtendedScript - Update Layer Marker
on Jan 12, 2020 at 9:10:00 am

I'm trying to to a marker update using extendedScript (Layer->Marker->'Update Marker from Source'). But to do this the layer on which this needs to be done needs to active. In my case it's an audio layer.

Here is what I have done so far with some help from the this link: https://forums.creativecow.net/thread/227/43715


Now the problem here is the code only works if the item (or composition) is opened. If the project is loaded but the item/composition is closed the above code doesn't work. If I open the item/composition manually and execute the above code works fine. The question now is how do I open the item/composition from the loaded project.

var bodyComp = app.project.items[13]; //MyComposition on the project which relates to item 13
var test= bodyComp.layers[8]; // my layer (audio in my case)

test.selected = true; //select the audio layer
app.executeCommand(2539); // execute the 'Update Marker from Source' from the menu


Return to posts index

Andrei Popa
Re: ExtendedScript - Update Layer Marker
on Jan 12, 2020 at 2:28:53 pm

var bodyComp = app.project.items[13]; //MyComposition on the project which relates to item 13
var test= bodyComp.layers[8]; // my layer (audio in my case)

bodyComp.openInViewer();
test.selected = true; //select the audio layer
app.executeCommand(2539); // execute the 'Update Marker from Source' from the menu


Andrei
My Envato portfolio.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]