Hi,
I had a wish: Replacing the editcontrol with a combo where you can choose the last entered expressions.
After a second I decided to change it by myself. Here are the changes:
Add the last line
Code:
; Specify the filename and directory location to save
; the cached key word/phrase of last search. There is
; no need to change this unless you want to.
keyPhrase = %tmp%\_Seek.key
RecentFileListCount = 9
change
Code:
NewKeyPhrase = %PrevKeyPhrase%
NewOpenTarget = %PrevOpenTarget%
; ADD THE TEXT BOX FOR USER TO ENTER THE QUERY STRING
Gui, 1:Add, Edit, vFilename W600, %NewKeyPhrase%
; ADD MY FAV TAGLINE
to
Code:
NewKeyPhrase = %PrevKeyPhrase%
OldSavedKeyPhrase = %NewKeyPhrase%
NewOpenTarget = %PrevOpenTarget%
; ADD THE TEXT BOX FOR USER TO ENTER THE QUERY STRING
Gui, 1:Add, ComboBox, vFilename W600, %NewKeyPhrase%
; ADD MY FAV TAGLINE
-----------------
change:
Code:
; SAVE THE KEY WORD/PHRASE FOR NEXT RUN IF IT HAS CHANGED
If TrackKeyPhrase = ON
{
If (PrevKeyPhrase <> Filename || PrevOpenTarget <> OpenTarget)
{
FileDelete, %keyPhrase%
FileAppend, %Filename%`n, %keyPhrase%
FileAppend, %OpenTarget%`n, %keyPhrase%
}
to
Code:
; SAVE THE KEY WORD/PHRASE FOR NEXT RUN IF IT HAS CHANGED
If TrackKeyPhrase = ON
{
Filenamenew:=RemoveOldEntries(Filename, OldSavedKeyPhrase)
If (PrevKeyPhrase <> Filenamenew || PrevOpenTarget <> OpenTarget)
{
FileDelete, %keyPhrase%
FileAppend, %Filenamenew%`n, %keyPhrase%
FileAppend, %OpenTarget%`n, %keyPhrase%
}
}
--------------
Add a new function
Code:
; === BEGIN RemoveOldEntries ========================
RemoveOldEntries(Filename, OldSavedKeyPhrase)
{
global RecentFileListCount
NewSavedKeyPhrase=
;Count the number of elements
nCounter = 1
Loop, parse, OldSavedKeyPhrase, |
{
IfGreaterOrEqual, nCounter, %RecentFileListCount%
{
break
}
;no duplicate entries
ifequal, filename, %A_LoopField%
{
continue
}
NewSavedKeyPhrase=%NewSavedKeyPhrase%|%A_LoopField%
nCounter +=1
}
StringLeft, FirstChar, NewSavedKeyPhrase, 1
ifnotequal, FirstChar, |
{
NewSavedKeyPhrase=|%NewSavedKeyPhrase%
}
Filename:=Filename . NewSavedKeyPhrase
return %Filename%
}
return
;... END RemoveOldEntries.............................
Ciao
Micha