Home › Forums › General XMetaL Discussion › Getting Cursor Position › Reply To: Getting Cursor Position
Reply to: Getting Cursor Position
May 15, 2009 at 9:21 pmAnother option (that might allow you to keep your current script with fewer changes) might be to turn of formatting before the slow part of your script (where selections are being manipulated).
Compare the speed of execution of the two following scripts and you will see that the second is far faster (with less flicker):
Script 1 (slow)
[code]//XMetaL Script Language JScript:
for (i=0;i<100;i++) {
Selection.MoveRight();
}[/code]
Script 2 (faster)
[code]
//XMetaL Script Language JScript:
ActiveDocument.FormattingUpdating=false;
for (i=0;i<100;i++) {
Selection.MoveRight();
}
ActiveDocument.FormattingUpdating=true;[/code]