Paragraph.appliedLanguage seems to differ from the actual applied language
Recently I wrote a script to deal with typographic interpunction glyphs. At some point I got confused:
I've set the doubleQuotes property of one particular language (Deutsch: 2006 Rechtschreibreform) once in the app without any open document (language.id == 61)
app.languagesWithVendors.itemByID(61).doubleQuotes
→ „“Then I opened a document and applied different glyphs for this (»«). When I now type quotes into the first paragraph, they are replaced by these glyphs.
The glyph setting in the document results in a new language id of 66:
document.languages.everyItem().id
→ 66
document.languages.itemByID(66).doubleQuotes
→ »«So far, everything is as expected. But when I inspect the language properties of the first paragraph, I get the setting from the app itself, although this does obviously not apply when typing.
document.textFrames.firstItem().paragraphs.firstItem().appliedLanguage.id
→ 61
document.textFrames.firstItem().paragraphs.firstItem().appliedLanguage.doubleQuotes
→ „“