Autohotkey (AHK) "Productivity" shortcuts
Posted: 21 Mar 2021 16:25
I was hoping that FHv7 would bring some "productivity" navigation improvements, things like retaining popup window sizes+positions for a new session, more shortcuts and more Alt+letter keyboard jumps, but the only thing I have noticed so far is that window sizes+positions are retained for:
- the new "Select Source..." popup via the Property Box Facts Tab (but not the "Select Source Record" via the All tab or Individual records/Named List)
- the new popup Source/Citation window.
That shows it is possible, so hope for the future.
So, I revisited Autohotkey (AHK) and with help from Window Spy (part of AHK), MacroCreator and forums, I took the AHK script from
AutoHotKey Scripts
and added a few more shortcuts.
To run AHK with an existing script was simpler than I thought, and once setup, one wonders why one hasn't been using it for years. And even I could manage to create some of the basic commands.
For editing I used Visual Studio Code with Extension AutoHotkey Plus Plus for structure colours etc. New learning curve for me, any one have a better AHK editor?
The difficulties I had:
- FH does not provide Alt+letter shortcuts from many of its popup windows.
- FH, Many "buttons" cannot be "tabbed" to.
- Many tab sequences are limited to only part of the window.
(But for the above, some buttons could be actioned with the AHK ControlFocus command).
- I could not get the "Esc" key to action.
- The popup windows without the "maximise" facility (e.g. Fact Types and Plugins): I could not get the ControlFocus command to work, or to action Alt+Enter to move or size the window.
Despite this I have created some favourites for myself, link below if anyone wants a peruse.
- Before running, you should read the AHK script (just open and read as a txt file, new bits from about line 59), to get the shortcut keys and what they do and why.
Download attachment [EDIT I managed to upload my file by removing the = from the file name!] ##### AS EVER YOU WOULD RUN THESE AT YOUR OWN RISK, TEST OUT ON A COPIED OR THE FH SAMPLE PROJECT #####
- Some of these Key combinations might do other things when outside FH.
So, these in particular:
[] Win+Alt+A - From "Property Box All tab, Records window, Named Lists, Query columns tree and probably any other tree with + - option"
This expands the "tree contents" by about 20 items, repeat until you have as much as you want. I am a recent convert to using these windows rather than the Property Box Facts Tab and this expansion makes an overview of an individual, and working with them so much easier.
[] Win+2 - If you have a regular Custom Report, in this case the first starting with 2, select individual > Win+2 > Report
[] Win+9 - To output your report to RTF file with a filename like yyyymmdd-hhmmss (so no need for overwrite messages) and open it in default App.
[] And 3 different options for adding a Source/Citation that takes you to a maximized "Select Source" window with cursor in the Filter box.
[] I have also found that for stubborn FH popup windows (e.g. Plugin, Fact Types) that the standard "Windows 10 Win key + Arrow keys" (especially Left and Right) are very quick.
For future reference I would be grateful if anyone can advise on better methods, new shortcuts, how to use ControlFocus for the "popup Windows without the maximise facility", how to jump to a specific item in a RightClick Menu. I am sure there must be a way to limit the "ahk_class #32770" popout windows so that keys are limited to the FH Program, similar to the "#IfWinActive, - Family Historian [GP][rojectdom]+ -"
- the new "Select Source..." popup via the Property Box Facts Tab (but not the "Select Source Record" via the All tab or Individual records/Named List)
- the new popup Source/Citation window.
That shows it is possible, so hope for the future.
So, I revisited Autohotkey (AHK) and with help from Window Spy (part of AHK), MacroCreator and forums, I took the AHK script from
AutoHotKey Scripts
and added a few more shortcuts.
To run AHK with an existing script was simpler than I thought, and once setup, one wonders why one hasn't been using it for years. And even I could manage to create some of the basic commands.
For editing I used Visual Studio Code with Extension AutoHotkey Plus Plus for structure colours etc. New learning curve for me, any one have a better AHK editor?
The difficulties I had:
- FH does not provide Alt+letter shortcuts from many of its popup windows.
- FH, Many "buttons" cannot be "tabbed" to.
- Many tab sequences are limited to only part of the window.
(But for the above, some buttons could be actioned with the AHK ControlFocus command).
- I could not get the "Esc" key to action.
- The popup windows without the "maximise" facility (e.g. Fact Types and Plugins): I could not get the ControlFocus command to work, or to action Alt+Enter to move or size the window.
Despite this I have created some favourites for myself, link below if anyone wants a peruse.
- Before running, you should read the AHK script (just open and read as a txt file, new bits from about line 59), to get the shortcut keys and what they do and why.
Download attachment [EDIT I managed to upload my file by removing the = from the file name!] ##### AS EVER YOU WOULD RUN THESE AT YOUR OWN RISK, TEST OUT ON A COPIED OR THE FH SAMPLE PROJECT #####
- Some of these Key combinations might do other things when outside FH.
So, these in particular:
[] Win+Alt+A - From "Property Box All tab, Records window, Named Lists, Query columns tree and probably any other tree with + - option"
This expands the "tree contents" by about 20 items, repeat until you have as much as you want. I am a recent convert to using these windows rather than the Property Box Facts Tab and this expansion makes an overview of an individual, and working with them so much easier.
[] Win+2 - If you have a regular Custom Report, in this case the first starting with 2, select individual > Win+2 > Report
[] Win+9 - To output your report to RTF file with a filename like yyyymmdd-hhmmss (so no need for overwrite messages) and open it in default App.
[] And 3 different options for adding a Source/Citation that takes you to a maximized "Select Source" window with cursor in the Filter box.
[] I have also found that for stubborn FH popup windows (e.g. Plugin, Fact Types) that the standard "Windows 10 Win key + Arrow keys" (especially Left and Right) are very quick.
For future reference I would be grateful if anyone can advise on better methods, new shortcuts, how to use ControlFocus for the "popup Windows without the maximise facility", how to jump to a specific item in a RightClick Menu. I am sure there must be a way to limit the "ahk_class #32770" popout windows so that keys are limited to the FH Program, similar to the "#IfWinActive, - Family Historian [GP][rojectdom]+ -"