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!
Need to change the Language to any other, in my case "Portuguese", and the Hyphenation/Spelling to "Hunspell".
Any help please?
Copy link to clipboard
Copied
Nobody?
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
Copy link to clipboard
Copied
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.