Notes for WSciTE Basic Macro Hack

2004-02-26: Updated for customised WSciTE 1.59
2004-10-11: Updated for customised WSciTE 1.61+
2005-04-06: Updated for customised WSciTE 1.63+

WSciTE 1.55: Introduction

Here are some notes in roughly chronological order. The button bitmaps were drawn by hand. This and all other changes for this feature hereby have their copyrights assigned to Neil Hodgson under the existing Scintilla/SciTE license. All the modified files reside under the scite/ directory tree.

WSciTE 1.55: Macro Buttons

WSciTE 1.55: Simple Macro Extension

WSciTE 1.55: Fixes for Macro Playing

Cleaning Up

Update for WSciTE 1.59

For WSciTE 1.59, a MultipleExtension interface has been implemented. Here is an incomplete list of additional changes made:

Update for WSciTE 1.61+

This version of WSciTE has a LuaExtension and is a bit later than the official 1.61 release (it is the CVS HEAD dated 20041010.) Here is a list of changes made, in chronological order:

WSciTE 1.61: Some Notes on Macro Messaging

Incoming macro messages, with the command "macro:record" has a string parameter in the form: message;wParam;{0|1}[;lParam]

message is an integer, wParam is an integer, and lParam is a string, and is present only if the third parameter is a 1. As far as I can tell, lParam is either zero or one characters, but it doesn't really matter to the extension.

Outgoing macro messages for execution is in the form: macrocommand:message;XYZ;wParam[;lParam]

"macrocommand:" is the prefix. message is an integer, XYZ is a sequence of 3 characters, wParam is either an integer or a string, lParam is either an integer or a string. If X is '0', the command (message) has no return value. If X is 'S', a string is returned, otherwise an integer is returned. If Y is 'R', wParam is a string, otherwise it is an integer. If Z is 'I', then lParam is present and it is an integer. If Z is 'S', then lParam is present and it is a string, otherwise it does not exist.

In order to properly handle macro sequences, an incoming message must be reformatted into a outgoing message. A macro sequence is collected as long as the command is "macro:record". The macro sequence is cleared when recording restarts after a "macro:stoprecord". When "macro:run" is encountered, the recorded sequence is played back, and the entire sequence is blocked as a single undo unit.

Update for WSciTE 1.63+

This version of WSciTE is dated a day or two later than the official 1.63 release (it is the CVS HEAD dated 20050405.) It turns out that the above method of running the macro (using macrocommand: and the Perform() method) does not work for the backslash character. I haven't found out why, but in the meantime, switching over to using the Send() method works and '\' is produced correctly with recorded and executed.


Copyright © 2003-2005 Man Kein Hong all rights reserved. Last Revised: 2005-04-06.
Home:
http://www.geocities.com/keinhong/ | Canonical URL: http://www.geocities.com/keinhong/scite/wscite_basic_macros.html
Hosted by www.Geocities.ws

1