Macro recording

Topics: User Forum
Nov 22, 2010 at 11:06 AM

Hi, how do you get macro recording to work properly? I added _scintilla.NativeInterface.StartRecord() and _scintilla.NativeInterface.StopRecord() to start and stop the macro, but how do I get playback to work? Do I have to send some sort of message to the editor? If so, how?

Nov 29, 2010 at 10:27 PM


You need to collect those keystroke in a file when you start/stop macro recording then play the content back from the file.

Here's how I resolved it, though not sure if that's the right way!

When you StartRecord, you need to create a file, ie macroKeyStroke.txt, then listen on CharAdded event for incoming keystrokes and add the keys into the file.

Close the file when you StopRecord.  On the PlayRecord, just use AddText and add the content back from the file.

Hope this helps!

Nov 30, 2010 at 11:08 AM

I tried that method and used a bool to check if keys should be added in the CharAdded event, not sure if Scintilla works with macros this way but it works, thanks :)