* Autohotkey (AHK) "Productivity" shortcuts

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile
Post Reply
User avatar
jimlad68
Megastar
Posts: 708
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Autohotkey (AHK) "Productivity" shortcuts

Post by jimlad68 » 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!]
FHv7 AutoHotkey jimlad68 extras 01.ahk
(9.46 KiB) Downloaded 11 times
##### 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]+ -"
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68

User avatar
ColeValleyGirl
Megastar
Posts: 2771
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Autohotkey (AHK) "Productivity" shortcuts

Post by ColeValleyGirl » 31 Mar 2021 19:31

Jim do you intend to submit this to the Knowledge Base? It would be a good addition

User avatar
jimlad68
Megastar
Posts: 708
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Re: Autohotkey (AHK) "Productivity" shortcuts

Post by jimlad68 » 31 Mar 2021 20:10

Helen, I am no programmer, but if it looks acceptable I am more than happy for it to be added.

If it were, unless vetted by "an expert" in AHK, I think it would be better as an addition with the usual caveats (as in my post).

All the instructions are contained in the script. I would also see things like this as works in progress and was hoping others might have their own routines to share.

Now I have AHK setup, I find I am using it for other things.

[edit - should I add it to https://fhug.org.uk/kb/add-download/ or perhaps
https://fhug.org.uk/kb/add-a-service-or-utility/]

P.S. I am still working on a "generic" for Hotkey to hide boxes in charts/diagrams (19120), very dear to my heart, but I don't suppose any great rush!
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68


User avatar
ColeValleyGirl
Megastar
Posts: 2771
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Autohotkey (AHK) "Productivity" shortcuts

Post by ColeValleyGirl » 01 Apr 2021 10:32

P.S. Notepad++ might be an editor to look add -- less of a sledgehammer than VisualStudioPlus: https://www.autohotkey.com/boards/viewtopic.php?t=50

PSpad might be another option: https://www.autohotkey.com/boards/viewtopic.php?t=6963 and has the advantage that you can also configure it to handle fh functions: Use PSPad to Format Functions

User avatar
jimlad68
Megastar
Posts: 708
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Re: Autohotkey (AHK) "Productivity" shortcuts

Post by jimlad68 » 01 Apr 2021 15:02

Helen thanks for those links:
notepad++ is my main text editor, mainly because it has the best I can find with a macro recorder/editor albeit very cumbersome and some useful plugins. MSWord is still good for macros if you are happy to paste in/out your text, NEVER saving as text as MSWord tends to "add things"! However I cannot find an addin for AHK structure, hence my use of Visual Studio.

I looked at your link re npp+ahk previously there have been problems with it, might be OK now. I think there is a way in NPP to create your own, but did not get around to it, also the Visual Studio Code with Extension AutoHotkey Plus Plus has popup help etc for commands.

I'll have another look at PSPad.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68

Post Reply