Copy link to clipboard
Copied
Hi All,
I have a 20 page document with some 30 linked graphics on each page, each with a live caption. when i'm ready to publish, i'd like to convert all the live captions to static (so as to be able to do some subtle editing on selected items).
can someone help me with a script to convert the live captions to static on ALL pages as opposed to one page at a time?
Thanks so much!!
Stef
Copy link to clipboard
Copied
Hi,
before run input your variable name (displayed in Text:Text Variables menu)
var myDoc = app.activeDocument;
var myCap = myDoc.textVariables.item("yourVarName"); // <== edit here
var l = myCap.associatedInstances.length;
while (l--)
myCap.associatedInstances[0].convertToText();
However much easier is to mouse-klick in UI:
select anyone of your caption instances ==>
go to Text:Text Variables:Define window ==>
choose your variable ==>
klick "convert to text" button.
Jarek
Copy link to clipboard
Copied
Did you mean the 0 in the last line to actually be an l? As in, it should be:
myCap.associatedInstances
.convertToText();
Copy link to clipboard
Copied
Hi @ dln385
What is wrong with converting item [0] - always first - in while loop?
Changing this to [1] leads to an error at the end ("object undefined")...
and the last one stay unconverted.
Jarek
Copy link to clipboard
Copied
Sorry, I misunderstood what the code was doing and thought that was a typo.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now