Script to find Variable Text and Convert to Text
Purpose: Variable Text can be controlled with paragraph styles but will ignore the GREP styles. Once converted to static text, the GREP styles kick in.
My sample code is here but I get errors at lines with colored text. I'm hoping someone could look at this and if possible suggest something to make it work. 17 thank you's !
main();
function main() {
// Find variable text by Modificaton Date
app.findGrepPreferences.findWhat = ("~o");
app.selection[0].parentStory.findGrep();
// Convert variable to text
app.menuActions.item("$ID/Convert Variable to Text").invoke();
}
