3 Replies Latest reply on Jul 27, 2017 8:40 AM by Ribnog

    Change Dictionary Preferences

    Ribnog

      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?

        • 1. Re: Change Dictionary Preferences
          Ribnog Level 1

          Nobody?

          • 2. Re: Change Dictionary Preferences
            Liphou Level 1

            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[n].name == app.translateKeyString("$ID/English: USA")) {
                                var result = languages[n].addDictionaryPath(fullPathOfUDC);  
                                languages[n].hyphenationVendor = "Hunspell";
                                languages[n].spellingVendor = "Hunspell";
                                // languages[n].doubleQuotes = ;
                                // languages[n].singleQuotes = ;
                            }
                        }
                    } 
                    myDoc.dictionaryPreferences.composition = ComposeUsing.BOTH;
                    myDoc.dictionaryPreferences.mergeUserDictionary = false;
                    myDoc.dictionaryPreferences.recomposeWhenChanged = true;
            

             

             

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

            1 person found this helpful
            • 3. Re: Change Dictionary Preferences
              Ribnog Level 1

              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.