Saving macros for later
Several people clued me in on a couple of ways to save macros for later. I haven’t had a chance to try either one yet (so someone correct me if I say something wrong about either), but they both sound great — and both are open-source.
(I’m really curious how they do it… I should look at their code sometime.)
GExperts Macro Library
GExperts includes a dockable Macro Library window. It lets you have multiple macros, lets you assign names and descriptions to them, and automatically saves them when you close the IDE.
I’m not sure where it saves them, though. This would be terrific if we could save them in revision control somehow — otherwise, with eight development machines, the macro I want would inevitably be on one of the other computers.
Keyboard macro manager on CodeCentral
TOndrej wrote a keyboard macro manager that you can compile into a design-time package and register in the IDE.
This one definitely can save the macros to a file, so could probably be used to share macros between computers.
April 5th, 2008 at 8:40 am
I believe GExperts macros are stored in {Program Files}\GExperts for Delphi 11\MacroLibrary.xml (replace the second part of this path with the folder where you have installed GExperts).
April 5th, 2008 at 9:06 am
re GExperts:
The Macro library stores the macros in \application data\gexperts\delphi \macrolibrary.xml
I am not sure whether it is possible to configure where it stores that file, but I have not found such an option. (OTOH it would be easy to add it, just grab the source code…)
It also has got an import and export function that reads/writes single macros in xml format.
April 5th, 2008 at 9:08 am
The comment function does not allow > and < in the text, so the above should have been:
[home]\application data\gexperts\delphi [version]\macrolibrary.xml
twm
April 5th, 2008 at 9:35 am
Interesting. On my computer, there’s nothing in AppData. GExperts is storing evering in Program Files. XP Pro here - are you running Vista?
April 6th, 2008 at 4:29 pm
The keyboard macro manager from code central doesn’t work correctly with D2007, but since it only claims compatbility with D6, I guess it isn’t a huge surprise (what will all the changes since then). It appears to keep refocusing the messages window instead.
It is a great example on how to create a toolbar in the IDE however, and chances are it can be fixed to work correctly with D2007 (perferably without driving me insane!)