• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Search for a comp marker by name.

Engaged ,
Apr 03, 2018 Apr 03, 2018

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

405

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
community guidelines

correct answers 1 Correct answer

Enthusiast , Apr 03, 2018 Apr 03, 2018

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;

  }

  }

}

Votes

Translate

Translate
Enthusiast ,
Apr 03, 2018 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;

  }

  }

}

Votes

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
community guidelines
Engaged ,
Apr 03, 2018 Apr 03, 2018

Copy link to clipboard

Copied

LATEST

Thank you Paul!

Votes

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
community guidelines