Home Forums General XMetaL Discussion Getting Cursor Position Reply To: Getting Cursor Position

Derek Read

Reply to: Getting Cursor Position

Another 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]

Reply

Products
Downloads
Support