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

how to remove "no markers detected" compiler error?

Community Beginner ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

i have created script about layer.marker and it works fine.

but when there are no marker on the layer, the error comes up.

is there any ways to hide the error? maybe like 'hasParent' function.

because i want to make it as preset and let the user freely to put the marker whenever they want.  thanks!

TOPICS
Error or problem , Expressions , How to , Scripting

Views

176

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
Advocate ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

Hey.

You can check for numKeys property to determine if a layer has any markers applied.

http://docs.aenhancers.com/properties/property/#property-numkeys

 

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
Community Expert ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

LATEST

Sounds like you want to write expressions instead of a script, but also with expressions it is as Tomas said: Check for numkeys:

 

if (myLayer.marker.numKeys == 0) {
  // do here whatever you want to do when no marker exists
}
else {
  // do where whatever you want to do if a marker exists
}
Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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