Reply To: Convert smart (curly) quotes to dumb (straight) quotes in InDesign using JS

Home Page / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Convert smart (curly) quotes to dumb (straight) quotes in InDesign using JS / Reply To: Convert smart (curly) quotes to dumb (straight) quotes in InDesign using JS

#79676
Peter Kahrel
Participant

You’re replacing text content, which is dangerous because you may delete index markers, cross-references, etc. etc. And you might make a mess of formatting. It’s safer to let InDesign do the replacements rather than JavaScript. Something like this:

[code]app.documents[0].textPreferences.typographersQuotes = false;
app.findGrepPreferences = app.changeGrepPreferences = null;

app.findGrepPreferences.findWhat = ‘(["’])’;
app.changeGrepPreferences.changeTo = ‘$1’;
imgtext.changeGrep();

app.documents[0].textPreferences.typographersQuotes = true;[/code]

Peter

This article was last modified on November 29, 2015

Comments (0)

Loading comments...