Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Context Sensitive AHK help


  • Please log in to reply
11 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Now TextPad has the added ability to click any command in the script being edited, and press 'Ctrl+2' to launch help directly on that command.

download: http://www.autohotke... ... extPad.zip

for AHK users not using TextPad, the following script will add that ability to ANY editor, even notepad. this script makes use of the index that is newly added to AHK's help. make sure u've the latest download.
(change path to help file in script)

SetTitleMatchMode, 2
setkeydelay, 0

$^2::
        IfWinNotActive, .ahk  ;check if the script has .ahk extension.
        {
        send, ^2
        return
        }

        Send, {home}^+{right}^c
        StringReplace, cmd, clipboard, %a_space%,, A
        StringReplace, cmd, cmd, %a_tab%,, A
        StringReplace, cmd, cmd, `,,, A
        ifwinnotexist,AutoHotkey Help,,run, E:\Program Files\AutoHotkey\AutoHotkey.chm
        winactivate, AutoHotkey Help
        winwaitactive, AutoHotkey Help
        send, !n
        ControlSend, Edit1, +{home}{bs}%cmd%{enter}, AutoHotkey Help
return

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


JonTheNiceGuy
  • Members
  • 22 posts
  • Last active: Oct 03 2013 01:33 PM
  • Joined: 22 Apr 2004
This should be %program files% or something similar near the end?

Regards,

Jon

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
if u mean instead of 'e:\program files' i should've used %programfiles% then it doesn't work for me... but i've already stated that path has to be changed before utilising.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Rajat,
I'll try to include your script in the help file somewhere so that users discover how to enable context senstive help. Nice work!

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
I've embellished your example and posted it here:
http://www.autohotke... ... veHelp.htm

It's referred to in the FAQ and the Edit command. Please let me know if you spot any corrections or improvements.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
oh boy!... u've changed my 1/2 page code to 2 pages!! ... great error handling!!

thanx.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
I used a lot of comments. I probably have more comments in my scripts & source than actual code.

Anyway, when the new Control commands become available, we can probably modify this script so that it doesn't use the clipboard.

cherub
  • Guests
  • Last active:
  • Joined: --
Hi,

has anybody this script working in VIM?

Greetings - cherub

creed.man
  • Members
  • 3 posts
  • Last active: Jun 05 2007 12:10 AM
  • Joined: 22 May 2007
got your script working in ultraedit. thanks a lot!

engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005
creed.man,

browse to your Autohotkey inatall folder (probable program files) and look in Extras\Editors\UltraEdit. AHK now comes with a script for configuring many editors for this sort of thing. You may notice tha Rajat's post is quite old, there have been a few improvements since then.

neXt
  • Members
  • 549 posts
  • Last active: May 20 2015 02:38 AM
  • Joined: 18 Mar 2007
There is a bug though, maybe it's just me, but context help does not dissapear which is a little bit frustraiting. But it's a cool feature after you add it in autorun and remove tray icon, so it's running stealth. :D

ScottMattes
  • Members
  • 195 posts
  • Last active: Feb 16 2015 01:43 AM
  • Joined: 21 May 2007
Thank you for this script, it is going in my autohotkey.ahk right now.

I added the following line

sleep, 100 ; added by scott, 2008-07-28, because the controlfocus is being ignored the first time help is invoked
controlfocus, Internet Explorer_Server1, A ; added by scott, 2008-07-24

just before the return at the end of the script. Now when I do Ctl+2 I can immediately scroll the description of the command.