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

Get Number of Comp Markers

New Here ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

Is there a way to get the total number of comp markers with a script?

How about a way to advance to the time of the next comp marker with a script?

TOPICS
Scripting

Views

877

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

Community Expert , Jul 06, 2018 Jul 06, 2018

This works as of CC 2017, I think.

Number of comp markers:

var myProp = myComp.markerProperty;

alert (myProp.numKeys)

Move CTI to next comp marker:

var myComp = app.project.activeItem;

var myProp = myComp.markerProperty;

var myTime = myComp.time;

var n = 0;

if (myProp.numKeys > 0){

n = myProp.nearestKeyIndex(myTime);

if (myProp.keyTime(n) <= myTime) n++;

if (n > myProp.numKeys) n = 0;

}

if (n > 0){

myComp.time = myProp.keyTime(n)

}

Dan

Votes

Translate

Translate
Community Expert ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

This works as of CC 2017, I think.

Number of comp markers:

var myProp = myComp.markerProperty;

alert (myProp.numKeys)

Move CTI to next comp marker:

var myComp = app.project.activeItem;

var myProp = myComp.markerProperty;

var myTime = myComp.time;

var n = 0;

if (myProp.numKeys > 0){

n = myProp.nearestKeyIndex(myTime);

if (myProp.keyTime(n) <= myTime) n++;

if (n > myProp.numKeys) n = 0;

}

if (n > 0){

myComp.time = myProp.keyTime(n)

}

Dan

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
New Here ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

LATEST

Thank you Dan! I knew that comp markers were now accessible through scripts, but couldn't find what I was doing wrong since it is so new.

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