How to target a layer other than the one currently selected
Posted: March 18th, 2018, 8:13 pm
I have a scenario where i need to be actively working on a specific layer, but need to target another one that is not selected (in my case, a layer called "HAND"). I've already set up a ScriptUI panel with buttons to add the markers and have it working fine, but you have to select the "HAND" layer first, like this:
How do I change the variable "mySelection" so that I can be working on an arbitrary layer and have the markers always get added to the layer called "HAND"? Thanks!
Code: Select all
var mySelection = app.project.activeItem.selectedLayers;
var compMarker = new MarkerValue("myMarker");
compMarker.duration = 2;
mySelection[0].Marker.setValueAtTime(app.project.activeItem.time, compMarker);