Home › Forums › General XMetaL Discussion › Highlighting current XML element with CSS › Reply To: Highlighting current XML element with CSS
Reply to: Highlighting current XML element with CSS
January 5, 2010 at 12:53 amHere's a JScript function that will “flash” the current element in XMetaL by repeatedly selecting the parent element and then reselecting the original selection. It's a bit of a silly hack, but it may be appropriate for certain kinds of “where am I?” situations.
[code]
//XMetaL Script Language JScript:
function flash_element(num_blinks) {
var obj=new ActiveXObject(“SQExtras.Methods”);
for (var i=1; i<=num_blinks; i++) {
var remember_position = ActiveDocument.Range;
Selection.SelectElement();
obj.GoToSleep(250); // 250 milliseconds = quarter second
remember_position.Select();
}
obj = null;
}
flash_element(3);
[/code]