Skip to main content
Known Participant
June 5, 2023
Answered

How to turn off Smart Quotes script in InDesign?

  • June 5, 2023
  • 2 replies
  • 1702 views

Hi

 

Someone recently helped me with this script to turn off 'smart reflow' in my preferences. Is it possible to do the same to turn off 'Smart  Typographer's Quotes'?

 

Thanks

 

 

#targetengine "smartText";

app.addEventListener("afterOpen", changeSmartText);

function changeSmartText(e) {
    if (e.parent.constructor.name == "LayoutWindow") {
        e.parent.parent.textPreferences.smartTextReflow = false;
        alert("This document's Smart Text Reflow has been set to: " + e.parent.parent.textPreferences.smartTextReflow)
    }
};

 

<Title renamed by moderator>

This topic has been closed for replies.
Correct answer m1b

My apologies. Because the alert call is spread over several lines, you must comment out each line.

//        alert(
//            'Set preferences:\n'
//            + 'Smart Text Reflow = ' + e.parent.parent.textPreferences.smartTextReflow + '\n'
//            + 'Typographer\'s quotes = ' + e.parent.parent.textPreferences.typographersQuotes + '\n'
//        );

 

2 replies

m1b
Community Expert
Community Expert
June 8, 2023

Hi @Davis_XI,  To remove the alert just remove the line that starts with "alert" or comment it out by adding two forward slashes // before the word "alert". - Mark

Davis_XIAuthor
Known Participant
June 12, 2023

Hi

Once again thank you for all your help. When I add the // I get the following error.

Thanks

 

 

m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
June 12, 2023

My apologies. Because the alert call is spread over several lines, you must comment out each line.

//        alert(
//            'Set preferences:\n'
//            + 'Smart Text Reflow = ' + e.parent.parent.textPreferences.smartTextReflow + '\n'
//            + 'Typographer\'s quotes = ' + e.parent.parent.textPreferences.typographersQuotes + '\n'
//        );

 

m1b
Community Expert
Community Expert
June 5, 2023

Hi @Davis_XI, it would be like this I think:

app.addEventListener("afterOpen", changeSmartText);
function changeSmartText(e) {
    if (e.parent.constructor.name == "LayoutWindow") {
        e.parent.parent.textPreferences.smartTextReflow = false;
        e.parent.parent.textPreferences.typographersQuotes = false;
        alert(
            'Set preferences:\n'
            + 'Smart Text Reflow = ' + e.parent.parent.textPreferences.smartTextReflow + '\n'
            + 'Typographer\'s quotes = ' + e.parent.parent.textPreferences.typographersQuotes + '\n'
        );
    }
};

- Mark

Davis_XIAuthor
Known Participant
June 8, 2023

Hi

Sorry its taken so long to reply! Thank you, thats great. At the moment I'm getting a window confirming the prefences have been changed. How woud I remove this feature, i don't really need it?

 

Thanks

Charu Rajput
Community Expert
Community Expert
June 8, 2023

You can hide the alerts, Add following Before running the script

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;

 

After execution completed,

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

 

Best regards