Highlighted

Search for a comp marker by name.

Contributor ,
Apr 03, 2018

Copy link to clipboard

Copied

Is it possible to search for a comp marker by name and get its time?

Yes, you can do this in CC 2017 or later. Here's an example that will give you the time of the first comp marker called "test" in the currently selected comp:

var activeItem = app.project.activeItem;

var search = "test";

if (activeItem != null && activeItem instanceof CompItem) {

  var markerProp = activeItem.markerProperty;

  for (var x = 1; x <= markerProp.numKeys; x++) {

  if (markerProp.keyValue(x).comment == search) {

  alert(markerProp.keyTime(x));

  break;

  }

  }

}

TOPICS
Scripting

Views

206

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Search for a comp marker by name.

Contributor ,
Apr 03, 2018

Copy link to clipboard

Copied

Is it possible to search for a comp marker by name and get its time?

Yes, you can do this in CC 2017 or later. Here's an example that will give you the time of the first comp marker called "test" in the currently selected comp:

var activeItem = app.project.activeItem;

var search = "test";

if (activeItem != null && activeItem instanceof CompItem) {

  var markerProp = activeItem.markerProperty;

  for (var x = 1; x <= markerProp.numKeys; x++) {

  if (markerProp.keyValue(x).comment == search) {

  alert(markerProp.keyTime(x));

  break;

  }

  }

}

TOPICS
Scripting

Views

207

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 03, 2018 0
Engaged ,
Apr 03, 2018

Copy link to clipboard

Copied

Yes, you can do this in CC 2017 or later. Here's an example that will give you the time of the first comp marker called "test" in the currently selected comp:

var activeItem = app.project.activeItem;

var search = "test";

if (activeItem != null && activeItem instanceof CompItem) {

  var markerProp = activeItem.markerProperty;

  for (var x = 1; x <= markerProp.numKeys; x++) {

  if (markerProp.keyValue(x).comment == search) {

  alert(markerProp.keyTime(x));

  break;

  }

  }

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 03, 2018 0
Contributor ,
Apr 03, 2018

Copy link to clipboard

Copied

Thank you Paul!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 03, 2018 0