From: Sammy Mitchell
David Marcus[SMTP:DavidMarcus@MindSpring.com] wrote:
> Is there a way to record a keyboard macro and have recording stop after you
> start a process such as spell checking?
>
> For instance, i want to record a macro that closes my current file, does a
> search and replace on the next file, and starts spell checking it. Is
here
> any way to do this?
Try the following - it seems to work for me, your mileage may vary!
/**************************************************************************
Turn off keyboard macro recording at any time. Assumes that is
your key to toggle recording. If not, change the constant below.
**************************************************************************/
constant TOGGLE_KEYMACRO_RECORDING =
/**************************************************************************
Hooked routine that gets called just after every keypress, but before the
key is given to the editor to process.
If we are currently recording a keyboard macro, and the 'toggle macro
recording' key is pressed, turn keyboard macro recording off.
This allows us to turn off keyboard macro recording at *any* time the
editor reads a key.
**************************************************************************/
proc AfterGetKey()
if Query(KbdMacroRecording) and Query(Key) == TOGGLE_KEYMACRO_RECORDING
Set(KbdMacroRecording, off)
Set(Key, -1) // tell TSE to ignore the key
endif
end
proc main()
Hook(_AFTER_GETKEY_, AfterGetKey)
end
--
Sammy Mitchell, SemWare Corp.
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)
|