KenHadley wrote:I would have a 'master' MS macro for each global hotkey and, based on checking for the active window, I could have two, three or even a dozen different ways of responding to CTRL-1, depending on which window/app was active. I will go back and try this.
Yes, that's the whole idea. That's the way to go.
In fact, you can expand JRL's idea/code above. Besides going to a particular line, your code can do extra things to meet your unique needs such as saving the file, boldly going beyond what the hotkey was originally designed for.
Code: Select all
GetActiveWindow>Title,WinX,WinY
Separate>Title,Notepad,res
If>res_count>1
SetFocus>Notepad*
Press alt
Send>eg
Release alt
WaitWindowOpen>Go To Line
Wait>0.5
// Extra functionalities
// Save the current file
Press CTRL
Send>s
Release CTRL
Exit>0
EndIf
/////////////////////////////////////
MDL>The script you want to run with ctrl + g.
KenHadley wrote:I migrated from AHK to MS for some of the same reasons you mention. When using AHK, I was plagued by idiosyncrasies and inconsistencies in the AHK macros that I wrote. If the mouse currently happened to be somewhere unexpected on the screen, or the cursor happened to be in an editable field, I would need to insert an extra AHK command to make the macro work. I found myself tweaking the AHK macros on a frequent, sometimes daily, basis. Since I moved to MS and have used its Image Recon and other features, my MS macros work flawlessly every time.
Thank you for sharing your first-hand user experience with AHK.