I'm scripting an automated indd -> PDF project and I need to minimise the user input.
To this end, I want to search and replace commas in a particular cell of a table (which are the only instances of a particular para style), and replace them with forced line breaks.
The script I have for another part of the XML import looks like this:
//Search the document for the umlauts and replaces them with macrons. I
app.findTextPreferences.findWhat = "Ï";
app.changeTextPreferences.changeTo = "Ī";
What do I add to a similar script to make it target only content whish has a particular para style? And will it be compatible with CS4, 5 and 5.5, i.e. be agnostic to nested styles etc?
Thanks in advance,
app.findTextPreferences.appliedParagraphStyle = "my_style";
.. your snippet here ..
I bet there is a reset somewhere above your snippet:
app.findTextPreferences = null;
app.changeTextPreferences = null;
and it would be safest to insert this as well below your code, or else this particular setting will "stick" and also be applied to following replaces.
This command is virtually unchanged since CS3, CS4? So far it seems to work in every version since then. But either way it's inconsequential to your nested styles, as these can only be character styles.
Thanks very much for that. I've bookmarked your reference again and scratched a memo onto my keyboard to do a proper search next time