If you experiment with reading/setting the OSX input language through the ObjC bridge, writing snippets like:
(function () {
'use strict';
ObjC.import('Carbon');
ObjC.import('stdio');
var sourceList = $.TISCreateInputSourceList(null, false);
var current_source = $.TISCopyCurrentKeyboardInputSource();
var cfs = $.TISGetInputSourceProperty(current_source, $.kTISPropertyInputSourceID);
var cfn = $.TISGetInputSourceProperty(current_source, $.kTISPropertyLocalizedName)
var sourceCount = $.CFArrayGetCount(sourceList)
return $.CFArrayGetValueAtIndex(sourceList, 0)
})();
we soon get obj reference return values of CF types. In ObjC itself these can be coerced to NS values. Any sense of how that can be achieved in JavaScript for Applications ?
(I am getting CF object reference return values from which I haven't succeeded in extract string or other primitive values)