failed to set values for TextDocument on first try.
When executing a simple script, it fails to set some text styles with SetValue on the first try.
var targetLayer = app.project.activeItem.layer(1);
var strArr = [
"حفظ حساب في الأرشيف",
"Archive an Account",
"เก็บบัญชีถาวร",
"एक खाते को आर्काइव करें"
];
var fntArr = [
"NotoSansArabic-Bold",
"Roboto-Bold",
"NotoSansThai-Bold",
"NotoSansDevanagari-Bold"
];
lang = 1; // select num (0-3) for change language and font
var textProp = targetLayer.property("ADBE Text Properties").property("ADBE Text Document");
var textDocument = textProp.value;
textDocument.resetParagraphStyle();
textDocument.resetCharStyle();
textDocument.font = fntArr[lang];
textDocument.text = strArr[lang];
textProp.setValue(textDocument);
//uncomment it for normal work
//textProp.setValue(textDocument);Hello! I use a very large number of layers (<1000) in my projects and use the dictionaries of JSON to localize them into different languages. From profiling the code, I can tell that the longest part of running my script is applying "textDocument" to the layer using setValue(). Therefore, it is highly undesirable to repeat this action.
