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
Copy link to clipboard
Copied
Someone made a script in this thread
Convert all live captions to static captions
https://indesignsecrets.com/how-to-install-scripts-in-indesign.php
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?
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
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();
}
}
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)
Copy link to clipboard
Copied
Hi Jongware
Thank you so much for the added knowledge.
I was racking my brain about how to deal with Enumerations.
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.