Skip to main content
Robert at ID-Tasker
Legend
July 27, 2023
Question

Text properties

  • July 27, 2023
  • 2 replies
  • 386 views

Quick question - can someone confirm if

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Text.html

have info about ALL properties for ALL languages?

Far East, Middle East, RightToLeft, etc.

I've done registry mod for Far East languages - Chinese, Japan, etc. - and I think I can see in the ObjectBrowser of the VB all of the Text properties from the link - 389 of them (this number includes all collections so "real" properties will be a bit less) - but would be great if someone can confirm.

TIA

 

This topic has been closed for replies.

2 replies

Peter Kahrel
Community Expert
Community Expert
July 31, 2023

> confirm if https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Text.html have info about ALL properties for ALL languages?

 

Confirmed. The English InDsign has all the properties and methods for Arabic, Hebrew, Japanese, etc.

Robert at ID-Tasker
Legend
July 31, 2023

Great, thank you. 

 

rob day
Community Expert
Community Expert
July 27, 2023

Hi @Robert at ID-Tasker , A Text object only has one applied language. If you get the language, the language applied to the first character of the text range is returned, if you set the text’s language, the language is applied to all of the text’s characters. If you are looking for all of the available languages I think that would be the application object’s languagesWithVendors collection.

 

So with some text selected I get this:

 

 

//some selected text
var t = app.activeDocument.selection[0].texts[0];
$.writeln(t.constructor.name)
//returns Text

$.writeln(t.appliedLanguage)
//returns a single language [object LanguageWithVendors]

$.writeln(t.appliedLanguage.name)
//returns English: USA

$.writeln(t.appliedLanguage.properties.toSource())
//returns all of the language’s properties
/* ({name:"English: USA", singleQuotes:"‘’", doubleQuotes:"“”", hyphenationVendor:"Hunspell", 
spellingVendor:"Hunspell", thesaurusVendor:"LILO", icuLocaleName:"en_US", untranslatedName:"English: USA", 
dictionaryPaths:["Library/Application Support/Adobe/Linguistics/UserDictionaries/Adobe Custom Dictionary/en_US", 
"Library:Application Support:Adobe:Linguistics:UserDictionaries:Adobe Custom Dictionary:el_GR:added.txt"], 
spellingVendorList:["Hunspell", "Proximity", "User Dictionary Only"], hyphenationVendorList:["Hunspell", "Proximity", "User Dictionary Only"], 
id:81, label:"", parent:resolve("/"), index:22}) */

//The application’s languages
var lv = app.languagesWithVendors
$.writeln(lv.length)
//returns 60

$.writeln(lv.everyItem().name)
//returns a list of the alailable languages
/* [No Language],Bengali (India),Gujarati (India),Hindi (India),Kannada (India),
Malayalam (India),Marathi (India),Oriya (India),Punjabi (India),Tamil (India),
Telugu (India),Bulgarian,Catalan,Czech,Danish,German: Swiss,German: Swiss 2006 Reform,
German: 1996 Reform,German: 2006 Reform,Greek,English: Canadian,English: UK,
English: USA,English: USA Medical,Spanish,Estonian,Finnish,French: Canadian,
French,Croatian,Hungarian,Italian,Lithuanian,Latvian,Norwegian: Bokmål,
Dutch: Old Rules,Dutch: 2005 Reform,Norwegian: Nynorsk,Polish,Portuguese: Brazilian,
Portuguese: Orthographic Agreement,Portuguese,Romanian,Russian,Slovak,Slovenian,
Swedish,Turkish,Ukrainian,English: USA Legal,German: Old Rules,Hebrew,Arabic,
German: Austria 2006 Reform,Indonesian (Indonesia),Khmer (Cambodia),Lao (Laos),
Burmese (Myanmar [Burma]),Sinhala (Sri Lanka),Thai */

 

 

Robert at ID-Tasker
Legend
July 27, 2023

Thanks, but that wasn't my question - I just need confirmation if info from the link - about all available properties for the Text - is listed there - or should I somehow activate MiddleEast version to get more properties.

 

rob day
Community Expert
Community Expert
July 27, 2023

I just need confirmation if info from the link - about all available properties for the Text

 

I think all the properties are listed, but you can get the list of properties from the text object and compare. This returns the properties and values from a selected text object:

 

 

var t = app.activeDocument.selection[0].texts[0].properties;
var cnt = 0
for (var x in t) {
    cnt++
    $.writeln(x + "   Value: " + t[x])
}
$.writeln(cnt)