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

Is there a way to find Live Caption boxes

Contributor ,
May 12, 2019 May 12, 2019

Copy link to clipboard

Copied

I have a document with hundreds of images. Initially I used the live caption option to help pupulate my image caption boxes. Whilst this helped at the beginning, I now prefer to have the live captions turned into static captions. I have done this for many of the captions but keep finding more.

Is there a way to use the "Find" functionality to identify and locate which captions are still "Live Caption". At present, I can see no way to identify which ones are which by looking at them. I need to right click each one to check it's  status and even then, it is easy to  miss some.

Is there a grep tool or a script that I could use?

Thanks

Views

525

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 ,
May 12, 2019 May 12, 2019

Copy link to clipboard

Copied

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
Contributor ,
May 12, 2019 May 12, 2019

Copy link to clipboard

Copied

Eugene, Thanks for this

I ran the script line;

app.documents[0].textVariables.everyItem().convertToText();

as suggested as the correct answer as a plain text .jsx file.

It did not give me an error message but then again it did not seem to work. I created a new Live Caption in the document and after running the script (i think, as I just used "run script" and nothing appeared to happen), the live  caption had not been converted. I do not believe this was  nested or in a table or anything special.

Any thoughts?

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 ,
May 13, 2019 May 13, 2019

Copy link to clipboard

Copied

Hi nermie ,

look again into:

Re: Convert all live captions to static captions

Here I stated that for nested structures this line would not work.

Instead address all instances of the text variables.

One warning:

You'd convert all instances of all used text variables with that.

Maybe you do not want that.

app.documents[0].stories.everyItem().textVariableInstances.everyItem().convertToText();

Best try this on a duplicate of your document.

Best,
Uwe

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
Guide ,
May 13, 2019 May 13, 2019

Copy link to clipboard

Copied

Laubender  wrote

One warning:

You'd convert all instances of all used text variables with that.

Maybe you do not want that.

Hi Uwe

what about testing variableType?

Something like this maybe?:

var myCaptions = app.documents[0].stories.everyItem().textVariableInstances.everyItem().getElements();

for (i = 0; myCaptions.length > i; i++) {

    if (myCaptions.associatedTextVariable.variableType.toString() == 'LIVE_CAPTION_TYPE') {

        myCaptions.convertToText();

    }

}

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 ,
May 13, 2019 May 13, 2019

Copy link to clipboard

Copied

Nice (and I'm sure it works perfectly!) but no need to convert to a string Just use

if (myCaptions.associatedTextVariable.variableType == VariableTypes.LIVE_CAPTION_TYPE)

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
Guide ,
May 13, 2019 May 13, 2019

Copy link to clipboard

Copied

LATEST

Hi Jongware

Thank you so much for the added knowledge.

I was racking my brain about how to deal with Enumerations.

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
Contributor ,
May 13, 2019 May 13, 2019

Copy link to clipboard

Copied

Thanks Uwe,

That seemed to work OK,

Thanks for others who chipped in with answers as well, but Uwe's simple script seems to have worked OK.

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