Skip to main content
Inspiring
January 12, 2026
Answered

Is there a way in InDesign SDK to detect whether a text frame is a Caption?

  • January 12, 2026
  • 1 reply
  • 134 views

Hello everyone,

 

I’m working with the InDesign C++ SDK and need to determine whether a given text frame is a caption created using InDesign’s Metadata / Live Caption feature.

 

Specifically, given a UIDRef of a text frame, I want to programmatically check:

  • whether the text frame is a caption (metadata/live caption).

Are there any recommended or official APIs/bosses to reliably identify caption text frames?

Any guidance, best practices, or SDK references would be appreciated.

 

Thanks in advance!

Correct answer Chetan S

Thanks Dirk for the input — that approach helped 👍
I’m now able to identify Live Captions correctly using that method.

However, I still have a question regarding Static Captions.

is there any hidden metadata / boss / attribute that can be used to identify static captions reliably?

1 reply

Legend
January 12, 2026

Just had a first look at it, so no definite answer:

It is a regular text frame, displaying a regular story.

The magic is in the contents – the live caption is implemented as text variable.

So you'd look at the owned item strand and find a kCalculatedTextVariableBoss, likely the trigger for the functionality is the constant in its IStringData "Live Metadata Caption: Name". Don't know how that connects to the actual compute, maybe a service.

The other thing that stands out is the character attributes strand, there is a kTextAttrPageNumberTypeBoss attribute in the overrides (the name telling about the original use of text variables) which specifies a "data position" of kDataPosition_TextVariable = 3.

Chetan SAuthorCorrect answer
Inspiring
January 12, 2026

Thanks Dirk for the input — that approach helped 👍
I’m now able to identify Live Captions correctly using that method.

However, I still have a question regarding Static Captions.

is there any hidden metadata / boss / attribute that can be used to identify static captions reliably?

Legend
January 12, 2026

As you ask "reliably" I think the answer is no, I've seen nothing persistent.

You could watch that it is created, but that is not reliable for existing docs.

When I relink an image, the static caption remains unchanged, so I'd say static means static here.