select every Variable Text Frame and turn it to static
Hello,
I am wondering if there is any way to create a script that would take every variable text frame, picking up the image name, to turn into a static text frame, so that I could use a GREP style to remove the suffix and apply a nested style.
I just realized that I cannot do a find or change or apply a nested paragraph style to a variable text frame. I have to convert it to static text first.
There has got to be a way to select every single text frame and covert it to static? I have found a few things, but nothing that I can figure out.
Been piecing together what I can find, but just getting errors.
var myDoc = app.activeDocument;
- var myCap = myDoc.textVariables.item(“Image Name”);
- var l = myCap.associatedInstances.length;
- while (l--)
- myCap.associatedInstances[0].convertToText();
This was my last attempt after finding something on the forum:
Any additional help would be greatly appreciated.
Best,
Babs
