Jump to content

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

GoTo - hotkeys, hotstrings, functions and labels in any editor [updated 28/4/14]


  • Please log in to reply
33 replies to this topic
A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

GoTo v1.0

 

* Better GUI with search (see screenshot below)
* GoTo now doesn't saves temporary files on the disk

 
GoTo runs in the background, monitors the currently editing autohotkey script and provides you with the ease of a hotkey, the many functions, labels, hotkeys and hotstrings present in the script in a simplified GUI. 
Selecting the item will enable you to directly go to that item in the Editor.
Yes, it's same like TillaGoto by TheGood which is also included in Sc4ahk but with the benefits that it supports all editors (not just Scintilla based) + supports hotstring , is fast and somewhat more dependable.
 

USING

  • Download the Goto script and run it.
  • Now open an ahk file in your favorite editor.
  • Press F7 to open GoTo window to see all items in that script.
  • Click on an item to go to it.

 

Requirements for an Editor to be compatitible with GoTo

  • Shows currently editing's full path in Title Bar
  • Has a GoTo option (Ctrl+G)

The above options are fulfilled by almost all the editors except Scite and Notepad
 
 
Tested Editors (from my side)
Will work with all Editors which show file full path in Title bar and have a Goto option like Sublime text, Notepad++, ConText
 
 
SCREENSHOT
fqluCTS.png


 
DOWNLOAD


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


JMeneses
  • Members
  • 161 posts
  • Last active: Oct 30 2015 02:10 PM
  • Joined: 17 Feb 2011

Your script is very interesting, i think my editor (UEStudio IDM Computer) meets the requirements, has a Goto (CTRL + G) and displays the full path in the title of the window but does not work.

 

Editing any AHK script, nothing comes in the dropdownlists

I can not upload screenshots???

 

Information AU3_Spy:

 

Title        [C:\Users\zjmenese\Documents\HSTI's\ACTUAL\GoTo v0.2.ahk] - UEStudio '13
Class      Afx:00400000:8:00010003:00000000:0006046A
Polsition  -8, -8
Size        1040, 754
Style       0x15CFC000
ExStyle   0x00000110
Hanle      0x00010476

 

Thanks



JMeneses
  • Members
  • 161 posts
  • Last active: Oct 30 2015 02:10 PM
  • Joined: 17 Feb 2011

It works by deleting the "[]" the path of the script AHK. Not as removing the two at a time but I work so

If (Instr(Title, "UEStudio") > 0 ) {
     Title := RegExReplace(Title,"(\[)","") 
     Title := RegExReplace(Title,"(\])","") 
  }


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

 

It works by deleting the "[]" the path of the script AHK. Not as removing the two at a time but I work so

If (Instr(Title, "UEStudio") > 0 ) {
     Title := RegExReplace(Title,"(\[)","") 
     Title := RegExReplace(Title,"(\])","") 
  }

Very good grin.png , but I think I will find a better way out i.e. make the script Editor Independent.

Thanks for your interest


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

Released v0.3

  • Now GoTo will just work with all editors which fulfill the two criteria. The independency was achievable by exploiting the fact that drive letters have :\ after them

Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


JMeneses
  • Members
  • 161 posts
  • Last active: Oct 30 2015 02:10 PM
  • Joined: 17 Feb 2011

Works perfect
thanks A v i



Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
This is quite useful indeed, A V I.

I made a few modifications that I find useful, maybe you'd like to implement some of them officially.

I added MainGuiEscape to hide the gui. I know we can press the same hotkey for that but in case we want to use one with modifiers it's more practical to just press escape when we want to cancel the search.

I don't like the fact that it creates a folder in my working directory so I changed it to A_Temp. You might want to make this path configurable.

You can still make the gui movable even without the caption using the code below.
 
OnMessage(0x201, "DragGui") ; WM_LBUTTONDOWN

DragGui()
{
	PostMessage, 0xA1, 2,,, A ; WM_NCLBUTTONDOWN
}
Thanks for sharing.

Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer) | Class_LV_Rows - Copy, Cut, Paste and Drag ListViews | Class_Toolbar - Create and modify | Class_Rebar - Adjustable GUI controls

Join the New AutoHotkey Forum!


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

This is quite useful indeed, A V I.

I know :-P
 

I added MainGuiEscape to hide the gui. I know we can press the same hotkey for that but in case we want to use one with modifiers it's more practical to just press escape when we want to cancel the search.

Very good idea indeed. I will add it.


I don't like the fact that it creates a folder in my working directory so I changed it to A_Temp. You might want to make this path configurable.

I prefer using script dir's path in my scripts, but now I feel I should migrate to AppData folder for storing settings. I think A_Temp can be insecure for storing settings as some crap cleaners may empty the folder at times but it will not matter, at least for this script. 
I will change it to A_temp OR customizable in the next improvement.
Thanks for the suggestion
 

You can still make the gui movable even without the caption using the code below.

That provides flexibility to the user in positioning the gui .
Thanks


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


gunner
  • Members
  • 79 posts
  • Last active: Aug 11 2013 11:18 AM
  • Joined: 05 Jun 2013

you have been posting some helpful scripts here.

thanks.

 

i use notepad and so this is useless for me but i will remember it when i switched to some better editor.



A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

you have been posting some helpful scripts here.
thanks.
 
i use notepad and so this is useless for me but i will remember it when i switched to some better editor.

Welcome.... grin.png 
It's all coming through because of some other project of mine's Sublime 4 AutoHotkey


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

GoTo v0.5

  • Made the Gui movable, Esc now hides the GUI
  • Made the script more customizable through the auto-exec function
  • Made the macro faster
  • Fixed bugs

Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
I noticed that some of the labels were not showing in a specific file I'm working, I checked the script but then I realized the file is too big to be quickly read line-by-line... What I really wanted to report is about some lines from GoTo_Readfile and Check4func functions. You have some commands in the same line of an assignment, like this:
block_comments := 0 , continue
This won't work because continue is not an expression, if you use it like this it will not be recognized as a command. You might have mistaken this from commands like IfEqual but in this case you'll need to use blocks.

Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer) | Class_LV_Rows - Copy, Cut, Paste and Drag ListViews | Class_Toolbar - Create and modify | Class_Rebar - Adjustable GUI controls

Join the New AutoHotkey Forum!


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

I noticed that some of the labels were not showing in a specific file I'm working,

How are the labels defined  in the script ?
 

 What I really wanted to report is about some lines from GoTo_Readfile and Check4func functions. You have some commands in the same line of an assignment, like this:

block_comments := 0 , continue
This won't work because continue is not an expression, if you use it like this it will not be recognized as a command. You might have mistaken this from commands like IfEqual but in this case you'll need to use blocks.

 

You are right. As the code showed right results everywhere, I thought inline continue is correct but it isn't

 

EDIT: I have updated the script


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012

How are the labels defined  in the script ?

It's not about how labels are defined, they are recognized by your script, it's about how long it takes to read a 10k lines script... If I wait long enough before opening the gui it will show all of them. Maybe you can think of something...

I just tested the new version and there's a problem with the Esc hotkey, it's not being disabled after the gui is closed. You don't need a hotkey for this, GuiEscape is a special type of label that only react to an specific gui.
 
GotoGuiEscape:
Gui, Goto:Hide
return
This is all you need.

Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer) | Class_LV_Rows - Copy, Cut, Paste and Drag ListViews | Class_Toolbar - Create and modify | Class_Rebar - Adjustable GUI controls

Join the New AutoHotkey Forum!


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

It's not about how labels are defined, they are recognized by your script, it's about how long it takes to read a 10k lines script... If I wait long enough before opening the gui it will show all of them. Maybe you can think of something...

Interesting.. I tried my script on Gdi plus.ahk.

I tried to be as fast as possible in activating N++ and then hitting F7 and surprisingly it worked well.

If you have 10k+ lines, that's massive and I recon the script should take about 1~1.2 sec to cache the data. Note that the script is smart in the sense that it uses the old cache for a file if it exists and the file is un-modified.

So, I guess this is the best that can be done. 

By the way, I have added SetBatchLines, -1 to offer some speed . Let's see what improvement does it bring for you.

 

And thanks for the GuiEscape fact, I didn't knew that, obviously you are more experienced than I.

 

I have updated the script to v0.6 with all the changes.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan