mkstevo - 2020-04-26

Since I went "native' on my Mac with the tremendous help of @trev and the compiled Mac binary, I've struggled to be able to view context sensitive help for Great Cow Basic. I had been able to find a .chm viewer for the Mac but hadn't been able to invoke it in a way that executed a search of the current "word" (as in alphabetical phrase, not a 16bit value).

For various reasons I've had to change my .chm viewer to iChm and I've spent the best part of today trying to get this to work, finally, I've got it working. Phew!

I'm using iChm version 1.4.3

Using Geany, here's what you need to do.
On the menu, select:
Edit > Preferences
In the preferences dialog select:
Tools

In the Commands / Context action: enter the following:

/Users/mkstevo/GreatCowBasic/Help/iChm.app/Contents/MacOS/iChm "/Users/mkstevo/GreatCowBasic/Help/gcbasic_V_98_01.chm" -search %s

That should all be entered on one line. Obviously you will need to alter the paths to reflect your username and directories.

The important section here is "-search" which starts iChm with a search command prepared, and the "%s" where the %s is replaced by Geany with the current word at the cursor. As these command line options for iChm seem to not be listed anywhere, it took me quite some time to find the correct syntax.

It is suggested in the Geany help that "%s" is available in other commands, but I could only get it to work from the "Context Action" section.

Then with a GCB file open, click on a GCB command ("Select" for example) right click on it, then select "Context Action". iChm should open with a collection of search results for "Select". You then have to choose which of the topics are most relevant to your search request by clicking on the returned results. Not totally perfect, but I have previously been having to open a browser, finding the GCB help pages and then searching manually. Getting this working will be a huge time saver for me.

It is possible to assign a keypress to the Context Action command, I have found that while this works, the iChm window opens behind the Geany window. Right clicking on the word and selecting the pop-up menu option brings iChm to the foreground.