AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Context Sensitive AHK help

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Wed Apr 21, 2004 1:01 am    Post subject: Context Sensitive AHK help Reply with quote

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.autohotkey.com/download/extras/editors/TextPad.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)

Code:
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

_________________
Back to top
View user's profile Send private message
JonTheNiceGuy



Joined: 22 Apr 2004
Posts: 18
Location: Manchester, UK

PostPosted: Fri Apr 23, 2004 12:27 am    Post subject: Surely... Reply with quote

This should be %program files% or something similar near the end?

Regards,

Jon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Fri Apr 23, 2004 12:54 am    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10474

PostPosted: Fri Apr 23, 2004 1:10 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10474

PostPosted: Fri Apr 23, 2004 4:57 pm    Post subject: Reply with quote

I've embellished your example and posted it here:
http://www.autohotkey.com/docs/scripts/ContextSensitiveHelp.htm

It's referred to in the FAQ and the Edit command. Please let me know if you spot any corrections or improvements.
Back to top
View user's profile Send private message Send e-mail
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Fri Apr 23, 2004 8:59 pm    Post subject: Reply with quote

oh boy!... u've changed my 1/2 page code to 2 pages!! ... great error handling!!

thanx.
_________________
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10474

PostPosted: Fri Apr 23, 2004 9:15 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
cherub
Guest





PostPosted: Mon Jul 31, 2006 8:40 am    Post subject: Seems not to work in VIM Reply with quote

Hi,

has anybody this script working in VIM?

Greetings - cherub
Back to top
creed.man



Joined: 22 May 2007
Posts: 3

PostPosted: Tue May 22, 2007 1:15 pm    Post subject: thanks, great script! Reply with quote

got your script working in ultraedit. thanks a lot!
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6856
Location: Pacific Northwest, US

PostPosted: Tue May 22, 2007 11:15 pm    Post subject: Reply with quote

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.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
neXt



Joined: 18 Mar 2007
Posts: 463

PostPosted: Wed May 23, 2007 4:47 am    Post subject: Reply with quote

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. Very Happy
Back to top
View user's profile Send private message
scottmattes



Joined: 21 May 2007
Posts: 94
Location: USA

PostPosted: Thu Jul 24, 2008 2:37 pm    Post subject: Reply with quote

Thank you for this script, it is going in my autohotkey.ahk right now.

I added the following line

Code:

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.
_________________
-------------
Scott Mattes

My small, but growing, collection of scripts.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group