• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Change Dictionary Preferences

Participant ,
Jul 26, 2017 Jul 26, 2017

Copy link to clipboard

Copied

Hi,

I spent all my day trying to realize how I change this options in Indesign using a script... even editing other codes that I found on the forum, but nothing happens... I can't take anymore!

image.jpg

Need to change the Language to any other, in my case "Portuguese", and the Hyphenation/Spelling to "Hunspell".

Any help please?

TOPICS
Scripting

Views

680

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 27, 2017 Jul 27, 2017

Copy link to clipboard

Copied

Nobody?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 27, 2017 Jul 27, 2017

Copy link to clipboard

Copied

Hi, bonjour,

Bonjour j'ai trouvé ce lien à voir : https://indesignsecrets.com/script-for-setting-indesign-preferences.php

delà, j'ai trouvé ce bout de code sur le site : InDesign Scripts by Keith Gilbert

myDoc.textDefaults.appliedLanguage = "English: USA";

        app.languagesWithVendors.itemByName('English: USA').addDictionaryPath(File('~/Library/Application Support/Adobe/Linguistics/UserDictionaries/Adobe Custom Dictionary/en_US'));

        var fullPathOfUDC = "Macintosh HD:Users:keithgilbert:Dropbox:Templates:keith_indesign_dictionary.udc";               

        if (File(fullPathOfUDC).exists) { 

            var languages = app.languagesWithVendors.everyItem().getElements();   

            for (var n=0; n<languages.length; n++) { 

                if (languages.name == app.translateKeyString("$ID/English: USA")) {

                    var result = languages.addDictionaryPath(fullPathOfUDC); 

                    languages.hyphenationVendor = "Hunspell";

                    languages.spellingVendor = "Hunspell";

                    // languages.doubleQuotes = ;

                    // languages.singleQuotes = ;

                }

            }

        }

        myDoc.dictionaryPreferences.composition = ComposeUsing.BOTH;

        myDoc.dictionaryPreferences.mergeUserDictionary = false;

        myDoc.dictionaryPreferences.recomposeWhenChanged = true;

Si ça peut aidé, Bonne soiré à vous tous

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 27, 2017 Jul 27, 2017

Copy link to clipboard

Copied

LATEST

Yes.. I aprecciate your help, is justly that code that I am trying to addapt but with no success.. I don't understand the "fullPathOfUDC" thing, because I only want to change the "Language" and "Hyphenation/Spelling", if is not Portuguese and Hunspell change for it, but not to add a new dictionary.

If someone could edit these lines of code to achieve what I want I'll be very grateful.

Thank you Liphou.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines