Jump to content

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

Active GoTo v4


  • Please log in to reply
85 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

What is the reason for

CurrLine = %A_LoopField%
	Check = %CurrLine%
	Check = %Check%
If you want to trim spaces away, wouldn't one of these lines have been enough.?!?

just the first won't do that, AFAIK. but it definitely can be optimized, there's a bit of an overkill there. i'll repost.

MIA

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


MsgBox
  • Guests
  • Last active:
  • Joined: --
Hello Rajat

This thread is flying now. :lol:

thanks for your kind words and review.

No problem, I just couldn't help myself. :)

I've updated the code with your change.

Thank you.
And thanks for clarifying the screenshot question. I thought that I was missing out on something. :)

I normally have multiple files open, so when I switch between files, I would like to see the list of sections for that file.

I would like this too for the same reason. I tried to code it myself but failed! :(

I have a request.
In some scripts (and especially my main one) the code looks similar to this:
$RButton::
$+RButton::
$+!RButton::
$+^RButton::
$+#RButton::
$+!^RButton::
$+!#RButton::
$+^#RButton::
$+!^#RButton::
$!RButton::
$!^RButton::
$!#RButton::
$!^#RButton::
$^RButton::
$^#RButton::
$#RButton::
   Code is here.
Return
Would it be possible without breaking your code to check for occurances like this and limit the output to just the first hotkey? As you can imagine, it takes up a lot of room in the display and is not nessesary.

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Dear MsgBox,
Sidenote: you may consider to use "$*RButton::"
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

This thread is flying now.

all thanks to you!

and toralf, you're right again about the hotkey simplification thing!

MIA

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


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

Your script reads the whole file and "loop,parse" through the var. Is that faster then "loop,read" through the file? Since you want to have this operation fast, I guess this loop should be speed optinized as much as possible. E.g. make the file type decision outside of that loop. etc.

I think the current way is faster/more efficient because the "loop, parse" way reads the whole file at once and does everything else internal to ahk, which is very fast... while for the other way, for every script line, ahk will have to acquire the file's handle, open it, read the requested line and then close it.

MIA

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


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
I've updated the script.

v3 Changes:
- Auto update of list based on the currently open file in editor.
- Pressing F5 will refresh the list

MIA

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


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
I'm planning to add some sort of editor detection at the launch of script so that users don't have to modify the code for that for most editors.

So everyone is welcome to post these parameters of your favourite editors here:

TitleStart = PSPad - [
TitleEnd = ]
GotoWin = Goto Line
GotoKey = ^g


toralf,
this will also add auto support for german PSPad (as you requested), so please provide its values here as well.

MIA

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


toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Only change for german PSPad
GotoWin = Gehe zu...
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

Thalon
  • Members
  • 641 posts
  • Last active: Jan 02 2017 12:17 PM
  • Joined: 12 Jul 2005
I did recognize this usefull tool today and I like it very much (but haven't tried it ^^).
I'll test it soon and if there are any suggestions I'll post them here, but I think toralf did already a good job ;)

I always prefere "FileRead" in combination with "Loop, Parse", because it is very fast in comparison :)

Thx,
Thalon

MsgBox
  • Guests
  • Last active:
  • Joined: --

I've updated the script.

v3 Changes:
- Auto update of list based on the currently open file in editor.
- Pressing F5 will refresh the list

Thank you very much Rajat. Posted Image
I can't think of any more improvements that I would like to see atm, so for me it's perfect!

@toralf

Sidenote: you may consider to use "$*RButton::"

Thanks for your suggestion. I will make the changes.
The script that that code came from is called NiftyWindows. I use it as my main script and have stripped out most of the code that I don't need and added some (alot :) ) of my own. I don't read code fluently :( , so it didn't jump out at me.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
I've updated the script with these changes:
- The GUI doesn't need to recreate itself when showing a new file's sections or while refreshing.
- The script checks if the current file is a script (ahk or au3). so opening a .txt file in your editor, with ActiveGoto running, won't bring the GUI out.

As these are relatively small changes, i've not increased the version counter.

MIA

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


Spike
  • Members
  • 19 posts
  • Last active: Dec 13 2011 12:12 AM
  • Joined: 24 Jun 2005
Hi Guys,
This script sounds like what I want!, but I cannot get it to run.
I'm using the latest build of PSPAD
(2234).

I've changed :-
TitleStart = PSPad - [
to = PSPad
As that is all that is visible in the main titlebar & if I have a ahk file loaded , a child window shows C:\Download\activegoto.ahk

What do I put here TitleEnd = ??.
I've tried 'C:\Download\activegoto.ahk' but that doesn't work !!.
Help please.
Thanks
Jan

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Spike,
its ready to be used for PSPad as it is... try running it without any change.

MIA

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


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
In another post Rabiator gave the idea of using 'GotoWin = ahk_class TfGotoLine' for PSPad, and I've modified the script to use this. No I hope it'll run on both of our systems without any changes!

MIA

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


toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
@Spike:
The PSPad window has to show the name of the file. Otherwise the script will not know which file you are working on.

@Rajat: The class might only be valid for PSPad. What about other editors?
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.