ScriptUI not reliable
Dear friends,
This time I'm really awake... In my script I check properties of graphic object and update a palette accordingly. I have now discovered, that for certain texts the ScriptUI functions are not reliable - or at least tricky to be used.
if (Fgr_IsOneOf("Arc Line Polyline", sType)){ // --- Arrow shapes -----------------------------
wPalP.g0.pArr.gTipNum.pTips.children[0].value = false; // assume no arrow
kArrow = Fgr_IsArrayInArray (goFgr.ARROWPROPS, [oObject.ArrowBaseAngle, oObject.ArrowTipAngle, oObject.ArrowLength/goFgr.PT, 0.25, oObject.ArrowType]);
if (kArrow === null) {
msgText = msgText + "Arrow shape is none of the pre-defined. ";
wPalP.g0.pArr.current.text = "Current: " + oObject.ArrowBaseAngle + "°, " + oObject.ArrowTipAngle + "°, " + oObject.ArrowLength/goFgr.PT + "pt, " + oObject.ArrowType;
// wPalP.g0.pArr.current.visible = true;
// wPalP.g0.pArr.current.graphics.foregroundColor = wPalP.g0.pArr.current.graphics.newPen (wPalP.g0.pArr.current.graphics.PenType.SOLID_COLOR, [1, 0, 0], 1);
// alert (wPalP.g0.pArr.current.text);
} else {
As you can see from the comment lines I was fiddling around with various hacks to make ...current.text appear. A similar part of the script with no special characters created no problems at all.The script is UTF-8 with BOM encoded and hence the degree symbol is a 2-byte entity.
With the above text I got success only with the additional alert!
Then I started with the text without any degree symbols ➔ OK. Then I succesively added the degree symbols ➔ still OK.
There must have been some strange character code in the string which did not allow to display the text. I could however not recognise this in the editor and may have wiped out this obstacle with the new set up of the string. But why could then an alert kick the text into visibility?
The dialogue looks like this (with the messages in red):


