


===========================
The question in the other forum:
------
It would be very useful to be able to set a group of shortcut keys in a macro.
My use case: I program in various languages, and would like to be able to put equivalent code constructs into a file by pressing the same key combinations regardless of what language I'm working with. For example, inserting a Class skeleton by pressing, say, Alt-F. When I'm working in Python, having set my keyboard to the Python mappings, I'd insert a basic Class structure in Python syntax; when using Java, having called up the Java macro, the same keypress would create a skeleton Java Class.
=========================
My reply:
Here is an untested rough skeleton:
Create this macro replacing "Do.....stuff" with the keystrokes you want to happen in that application. Assign a hot-key combination that you want to trigger this macro. As noted in this example, ALT-F11 would run the macro. This would allow one hot-key, ALT-F11, to do different things in Notepad, JavaDeveloper, and Other applications.//HotKey for this macro is ALT-F11
GetActiveWindow>window_title,...............
If>%window_title%=Notepad,Notepad
If>%window_title%=JavaDeveloper,Java
If>%window_title%=OtherName,Other
Repeat as needed for multiple programs
Goto End
Label>Notepad
Do stuff
Goto End
Label>Java
Do oter stuff
Goto End
Label>Other
Do more stuff
Goto End
Label>End