| View previous topic :: View next topic |
| Author |
Message |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Wed Apr 21, 2004 1:01 am Post subject: Context Sensitive AHK help |
|
|
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 |
|
 |
JonTheNiceGuy
Joined: 22 Apr 2004 Posts: 18 Location: Manchester, UK
|
Posted: Fri Apr 23, 2004 12:27 am Post subject: Surely... |
|
|
This should be %program files% or something similar near the end?
Regards,
Jon |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Fri Apr 23, 2004 12:54 am Post subject: |
|
|
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 |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10474
|
Posted: Fri Apr 23, 2004 1:10 am Post subject: |
|
|
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 |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10474
|
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Fri Apr 23, 2004 8:59 pm Post subject: |
|
|
oh boy!... u've changed my 1/2 page code to 2 pages!! ... great error handling!!
thanx. _________________
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10474
|
Posted: Fri Apr 23, 2004 9:15 pm Post subject: |
|
|
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 |
|
 |
cherub Guest
|
Posted: Mon Jul 31, 2006 8:40 am Post subject: Seems not to work in VIM |
|
|
Hi,
has anybody this script working in VIM?
Greetings - cherub |
|
| Back to top |
|
 |
creed.man
Joined: 22 May 2007 Posts: 3
|
Posted: Tue May 22, 2007 1:15 pm Post subject: thanks, great script! |
|
|
| got your script working in ultraedit. thanks a lot! |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6856 Location: Pacific Northwest, US
|
Posted: Tue May 22, 2007 11:15 pm Post subject: |
|
|
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 |
|
 |
neXt
Joined: 18 Mar 2007 Posts: 463
|
Posted: Wed May 23, 2007 4:47 am Post subject: |
|
|
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.  |
|
| Back to top |
|
 |
scottmattes
Joined: 21 May 2007 Posts: 94 Location: USA
|
Posted: Thu Jul 24, 2008 2:37 pm Post subject: |
|
|
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 |
|
 |
|