AutoHotkey Community

It is currently May 27th, 2012, 8:23 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: January 8th, 2012, 6:01 am 
Offline

Joined: April 13th, 2010, 9:53 pm
Posts: 65
Location: New Zealand
Ever find pressing scrolling through the F1 help documentation boring and useless? Well never ever you will need to do that, with this SciTE4AutoHotkey addon, you get instant help from your debug box at the bottom. Simply run the script (or autorun the script which I will talk about later) and Alt Click a line, a search will be launched you may find help! Interesting isn't it :D. Idea was from kookster on the FreeNode #ahk IRC, so kudos to him! AutoHotkey_L is also required.

Image

...is Simple
Run and script and press Alt Click on the line that you need help with.

...is Automatic
If you are lazy like me, then you can edit the AutoRun.ahk file in your SciTe4AutoHotkey directory (most likely to be at %A_AHKPath%\SciTE\Autorun.ahk) and add this line of code
Code:
Run, directory_to_where_you_saved_the_help_script.ahk

After you exit SciTE4AutoHotkey it will exit along with it.

Code:
#SingleInstance Force
#NoTrayIcon
#IfWinActive ahk_class SciTEWindow
#NoEnv
SetBatchLines, -1
WinWait, ahk_class SciTEWindow
SetTimer, GuiUpdate, 0
Gui, -Caption +AlwaysOnTop +ToolWindow
Gui, Add, ActiveX, vActiveX, Shell.Explorer
ActiveX.Navigate("http://www.autohotkey.com/forum/")

GuiUpdate:
If (WinActive("ahk_class SciTEWindow") Or WinActive("SciTE4AutoHotkey Online Help Documentation Graphical User Interface")){
   WinGetPos, WindowX, WindowY,, WindowHeight, ahk_class SciTEWindow
   ControlGetPos, ControlX, ControlY, ControlWidth, ControlHeight, Scintilla2, ahk_class SciTEWindow
   MouseGetPos,,, MouseWindow, MouseControl
   WinGetClass, MouseWindow, ahk_id %MouseWindow%
   WinSet, Transparent, % MouseWindow = "AutoHotkeyGUI" ? 230 : 80,  SciTE4AutoHotkey Online Help Documentation Graphical User Interface
   If (RegExMatch(MouseWindow, "SciTEWindow|AutoHotkeyGUI") And !GetKeyState("LButton"))
      WinActivate, ahk_class %MouseWindow%
   GuiControl, Move, ActiveX, % "w" ControlWidth "h" ControlHeight
   Gui, Show, % "x" WindowX + ControlX "y" WindowY + ControlY "w" ControlWidth "h" ControlHeight "NoActivate", SciTE4AutoHotkey Online Help Documentation Graphical User Interface
}
Else If (!WinExist("ahk_class SciTEWindow"))
   ExitApp
Else
   Gui, Hide

!LButton::
SendInput, {LButton}
ControlGetText, ControlText, Scintilla1, ahk_class SciTEWindow
ControlGet, ControlLine, CurrentLine,, Scintilla1, ahk_class SciTEWindow
ControlText := RegExReplace(StrGet(&ControlText, "UTF-8"), "`r")
InStr = 0
Loop, % ControlLine - 1
   InStr := InStr(ControlText, "`n", "False", InStr + 1)
RegExMatch(ControlText, "\w+", ControlCommand, InStr + 1)
ActiveX.Navigate("http://www.google.com/search?q=site:autohotkey.com " ControlCommand "")

_________________
Image+Leo Xiong
#ahk - Freenode - Catch me there as NameLess-exe!


Last edited by Leo Xiong on April 28th, 2012, 3:49 pm, edited 6 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2012, 6:20 am 
Offline
User avatar

Joined: September 1st, 2011, 8:21 pm
Posts: 368
Location: California
it is a great idea but the viewing area is really limited.
may I suggest to change the last line to:
Code:
ActiveX.Navigate("http://www.autohotkey.com/docs/commands/" ControlCommand ".htm")
instead of google search!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2012, 6:27 am 
Offline

Joined: April 13th, 2010, 9:53 pm
Posts: 65
Location: New Zealand
Alpha Bravo wrote:
it is a great idea but the viewing area is really limited.
may I suggest to change the last line to:
Code:
ActiveX.Navigate("http://www.autohotkey.com/docs/commands/" ControlCommand ".htm")
instead of google search!

You can drag box bigger too.
It is an option, but I think it would be good to search through forum posts too.

_________________
Image+Leo Xiong
#ahk - Freenode - Catch me there as NameLess-exe!


Last edited by Leo Xiong on January 8th, 2012, 9:26 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2012, 7:10 am 
Great job! thanks alot! it's very helpful. :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2012, 2:24 pm 
Offline

Joined: September 15th, 2008, 2:40 pm
Posts: 20
Location: Hungary, Budapest
For several reasons I use notepad2-mod instead of scite:
slash " and '
join lines
selection moving in code with up and down arrows
easy swap word wrap/long lines
sort lines
bookmark lines

the only thing I miss, result panel at run code.
;_;


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2012, 9:51 pm 
Offline

Joined: April 27th, 2008, 5:28 pm
Posts: 489
I downloaded your script and ran it. I alt - clicked on a line in Scite4Autohotkey and all I get is a google search for site:autohotkey.com 4

I tried Alpha Bravos suggestion
Code:
ActiveX.Navigate("http://www.autohotkey.com/docs/commands/" ControlCommand ".htm")
and all I get is page not found.

What went wrong?

I am using Autohotkey_L Ansi 32 bit.

DataLife

_________________
Check out my scripts.
(MyIpChanger) (XPSnap) (SavePictureAs)

All my scripts are tested on Windows 7, AutoHotkey_L 32 bit Ansi unless otherwise stated.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2012, 5:55 am 
Offline

Joined: April 13th, 2010, 9:53 pm
Posts: 65
Location: New Zealand
DataLife wrote:
I downloaded your script and ran it. I alt - clicked on a line in Scite4Autohotkey and all I get is a google search for site:autohotkey.com 4

I tried Alpha Bravos suggestion
Code:
ActiveX.Navigate("http://www.autohotkey.com/docs/commands/" ControlCommand ".htm")
and all I get is page not found.

What went wrong?

I am using Autohotkey_L Ansi 32 bit.

DataLife


Depends if you clicked on a command/variable that isn't a valid url.

_________________
Image+Leo Xiong
#ahk - Freenode - Catch me there as NameLess-exe!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2012, 7:10 pm 
Offline

Joined: April 27th, 2008, 5:28 pm
Posts: 489
Leo Xiong wrote:
DataLife wrote:
I downloaded your script and ran it. I alt - clicked on a line in Scite4Autohotkey and all I get is a google search for site:autohotkey.com 4

I tried Alpha Bravos suggestion
Code:
ActiveX.Navigate("http://www.autohotkey.com/docs/commands/" ControlCommand ".htm")
and all I get is page not found.

What went wrong?

I am using Autohotkey_L Ansi 32 bit.

DataLife


Depends if you clicked on a command/variable that isn't a valid url.


I clicked on ControlSetText.

_________________
Check out my scripts.
(MyIpChanger) (XPSnap) (SavePictureAs)

All my scripts are tested on Windows 7, AutoHotkey_L 32 bit Ansi unless otherwise stated.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2012, 5:48 pm 
Offline

Joined: April 27th, 2008, 5:28 pm
Posts: 489
Is there any particular version of AutoHotkey required for this script?

_________________
Check out my scripts.
(MyIpChanger) (XPSnap) (SavePictureAs)

All my scripts are tested on Windows 7, AutoHotkey_L 32 bit Ansi unless otherwise stated.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2012, 12:41 am 
Offline

Joined: April 27th, 2008, 5:28 pm
Posts: 489
Here is the contents of the variable ControlText retrieved with this line of code
Code:
ControlGetText, ControlText, Scintilla1, ahk_class SciTEWindow


Code:
?????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
???????????????????=????????????????????????????????????????
???????????????????????????????????????????????†????????????????
?????†????????????????????

_________________
Check out my scripts.
(MyIpChanger) (XPSnap) (SavePictureAs)

All my scripts are tested on Windows 7, AutoHotkey_L 32 bit Ansi unless otherwise stated.


Last edited by DataLife on March 8th, 2012, 5:36 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 5th, 2012, 10:40 am 
Offline

Joined: April 13th, 2010, 9:53 pm
Posts: 65
Location: New Zealand
DataLife wrote:
Here is the contents of the variable ControlText retrieved with this line of code
Code:
ControlGetText, ControlText, Scintilla1, ahk_class SciTEWindow


Sorry, yes, AutoHotkey_L is required for the objects.

_________________
Image+Leo Xiong
#ahk - Freenode - Catch me there as NameLess-exe!


Last edited by Leo Xiong on April 28th, 2012, 3:48 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2012, 4:06 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
Tip: since you're using AutoHotkey_L, you might want to change:
Code:
ActiveX.Navigate("http://www.autohotkey.com/docs/commands/" ControlCommand ".htm")

to:
Code:
ActiveX.Navigate("http://l.autohotkey.net/docs/commands/" ControlCommand ".htm")

in order to use the more up-to-date AutoHotkey_L documentation instead of the old and outdated AutoHotkey Basic documentation.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2012, 5:26 pm 
DataLife wrote:
Is there any particular version of AutoHotkey required for this script?

Is autohotkey unicode required for this script?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2012, 5:42 pm 
Offline

Joined: April 27th, 2008, 5:28 pm
Posts: 489
Can anyone explain why I am still getting
Code:
?????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
???????????????????????????4??????????????????????????????????????
???????????????????=????????????????????????????????????????
???????????????????????????????4????????????????†????????????????
?????†????????????????????


for the variable ControlText retrieved by this line?
Code:
ControlGetText, ControlText, Scintilla1, ahk_class SciTEWindow


I am clicking on a gosub line.

_________________
Check out my scripts.
(MyIpChanger) (XPSnap) (SavePictureAs)

All my scripts are tested on Windows 7, AutoHotkey_L 32 bit Ansi unless otherwise stated.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: AndyJenk, Aravind, Google Feedfetcher, Stigg and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group