Skip to main content
Inspiring
September 28, 2023
Answered

Set automatic marker

  • September 28, 2023
  • 1 reply
  • 481 views

Hi,

Is there a way to automatically set markers in After Effects or Premiere Pro? I would need a marker in a layer every time the layers below it end (see attached image, the green lines and points).

 

Thanks and regards, Sven

This topic has been closed for replies.
Correct answer ShiveringCactus

While I feel like there's probably a solution on AEScripts.com, it might be just as quick to hold SHIFT while scrubbing the timeline, so that the current time indicator jumps to the next layer inpoint and then hit * on the numberpad.  I know it feels labour intensive, but I've just done a quick search and not found anything obvious

 

Ignore that last bit, I've just asked ChatGPT and it came up with this:

// Get the active composition
var comp = app.project.activeItem;

// Check if a composition is active
if (comp && comp instanceof CompItem) {
    // Loop through all layers in the composition
    for (var i = 1; i <= comp.numLayers; i++) {
        var layer = comp.layer(i);
        // Add a marker at the layer's inpoint
        var marker = new MarkerValue("Layer " + i + " Inpoint Marker");
        comp.markerProperty.setValueAtTime(layer.inPoint, marker);
    }
} else {
    // If no composition is active, show an error message
    alert("Please select a composition.");
}

 

One quick test and it seems to work.

1 reply

ShiveringCactus
Community Expert
ShiveringCactusCommunity ExpertCorrect answer
Community Expert
September 29, 2023

While I feel like there's probably a solution on AEScripts.com, it might be just as quick to hold SHIFT while scrubbing the timeline, so that the current time indicator jumps to the next layer inpoint and then hit * on the numberpad.  I know it feels labour intensive, but I've just done a quick search and not found anything obvious

 

Ignore that last bit, I've just asked ChatGPT and it came up with this:

// Get the active composition
var comp = app.project.activeItem;

// Check if a composition is active
if (comp && comp instanceof CompItem) {
    // Loop through all layers in the composition
    for (var i = 1; i <= comp.numLayers; i++) {
        var layer = comp.layer(i);
        // Add a marker at the layer's inpoint
        var marker = new MarkerValue("Layer " + i + " Inpoint Marker");
        comp.markerProperty.setValueAtTime(layer.inPoint, marker);
    }
} else {
    // If no composition is active, show an error message
    alert("Please select a composition.");
}

 

One quick test and it seems to work.