Copy link to clipboard
Copied
You could use the text search/replace feature of InDesign. Try the following
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat = "FOO";
app.changeTextPreferences.changeTo = "BAR"
app.activeDocument.changeText ();
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
-Manan
Copy link to clipboard
Copied
BTW, I need a solution where I can call a function for every FOO to get the actual replacement done. In case this is important. I already have a datastructure like obj['id'] = {'id':a, param1:b ...} and need to replace "{{id:param1}}" with its content. That works. Its just that i dont know how to find and replace just_text_anywhere.
Copy link to clipboard
Copied
You could use the text search/replace feature of InDesign. Try the following
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat = "FOO";
app.changeTextPreferences.changeTo = "BAR"
app.activeDocument.changeText ();
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
-Manan