AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AutoComplete for Files and Folders
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Meta (not signed in)
Guest





PostPosted: Wed Dec 17, 2008 5:32 am    Post subject: AutoComplete for Files and Folders Reply with quote

I was about to start writing a script for this, but just wanted to check if anyone has done it already maybe. I tried the search function but to no avail. Basically what I'm aiming for is EXACTLY the functionality of the filename textbox in open/save dialogs. That is, as you type a path, a listbox shows up underneath the textbox showing you different files and directories that match what has already been typed.

Has anyone already done this?
Back to top
wontstoptalking



Joined: 14 Dec 2008
Posts: 42

PostPosted: Wed Dec 17, 2008 5:44 am    Post subject: Reply with quote

That sounds pretty difficult....but then again I'm a wimp.

You'd probably need to have some kind of .txt file to read off of...one that contains a list of all your common files. You could probably even find a program to make that .txt file for you. Then you could get autohotkey to read from it, and somehow get it to autocomplete for you.....

Sorry I can't do more than state the obvious Smile

If you come up with anything good, I want to see it. That sounds really useful.
Back to top
View user's profile Send private message
Meta*
Guest





PostPosted: Wed Dec 17, 2008 2:02 pm    Post subject: Reply with quote

Very well, I shall get to it then!
Back to top
JoeSchmoe as guest
Guest





PostPosted: Wed Dec 17, 2008 11:09 pm    Post subject: Reply with quote

Search for 320MPH.

If you've made any progress, let me know. I'd like to make a program like this.
Back to top
Z_Gecko
Guest





PostPosted: Wed Dec 17, 2008 11:41 pm    Post subject: Reply with quote

Help wrote:
ListBox Options:
Sort: Automatically sorts the contents of the list alphabetically (this also affects any items added later via GuiControl). The Sort option also enables incremental searching, which allows an item to be selected by typing the first few characters of its name.
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Thu Dec 18, 2008 1:14 am    Post subject: Reply with quote

Code:
Gui, Add, Combobox, x7 y7 w550 h21 Choose1 hwndhSHAC vtFolder, %tFolder%
ControlGet, hMyEdit, hWnd,, Edit1, ahk_id %hSHAC%
DllCall( "ole32\CoInitialize", UInt,0 )
DllCall( "shlwapi\SHAutoComplete", UInt,hMyEdit, UInt,0x1|0x10000000 )
Gui, Add, Button, x+5 w30 hp +Default gExecute, Go
Gui, Show, h130, ShAutoComplete
Return

Execute:
 ControlGetText,cmdLine,, ahk_id %hSHAC%
 Run, %CmdLine%
Return

; Above code taken from IconEx-v1.00: www.autohotkey.com/forum/topic31670.html
; Originally, Sean posted at : www.autohotkey.com/forum/viewtopic.php?p=121621#121621

_________________
URLGet - Internet Explorer based Downloader
Back to top
View user's profile Send private message Send e-mail
Meta*
Guest





PostPosted: Fri Dec 19, 2008 7:18 pm    Post subject: Reply with quote

Thank you SKAN!
I was fooling around with other programs and noticed that this feature was too common and similar for it to be an internal code thing. So then I realized there's probably an API function somewhere that takes care of it. As soon as I found it on msdn, I came here and searched for it, and your reply came up!
Thank you very much!
Back to top
soggos



Joined: 27 Mar 2008
Posts: 129
Location: France

PostPosted: Tue May 26, 2009 9:01 am    Post subject: Reply with quote

Very Happy Hello, it's very good.
Question Nobody knows to make that with like entry a file?
_________________
with ahk, all is different!...<img>
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Tue May 26, 2009 2:57 pm    Post subject: Reply with quote

soggos, you could add the something like following

Code:
tFolder := "http://www.autohotkey.com/forum"

at the top of the example script posted above
Back to top
View user's profile Send private message Send e-mail
soggos



Joined: 27 Mar 2008
Posts: 129
Location: France

PostPosted: Tue May 26, 2009 7:36 pm    Post subject: Reply with quote

hello mister SKAN,
i don't understand...
so, with tfolder:= c:\mydir >it's good for me(good retrive files or folder)
but with http, i dont understand.....
simply:
i have a file .txt with many commands , and like notepad++, i just want to retrieve found terms begin like tfolder, you see?
_________________
with ahk, all is different!...<img>
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Tue May 26, 2009 8:48 pm    Post subject: Reply with quote

soggos wrote:
i have a file .txt with many commands , and like notepad++, i just want to retrieve found terms begin like tfolder, you see?


I am not sure of your requirement.. Can you post a small sample of your .txt file ?
Back to top
View user's profile Send private message Send e-mail
soggos



Joined: 27 Mar 2008
Posts: 129
Location: France

PostPosted: Wed May 27, 2009 6:03 am    Post subject: Reply with quote

SKAN
Quote:
I am not sure of your requirement.. Can you post a small sample of your .txt file ?

OhO, it's a file like Commands.txt or Variables.txt,::>
Code:

ExitApp [, ExitCode]
FileAppend [, Text, Filename]
FileCopy, Source, Dest [, Flag (1 = overwrite)]
FileCopyDir, Source, Dest [, Flag]
FileCreateDir, Path
FileCreateShortcut, Target, C:\My Shortcut.lnk [, WorkingDir, Args, Description, IconFile, ShortcutKey, IconNumber, RunState]
FileDelete, FilePattern
FileGetAttrib, OutputVar(RASHNDOCT) [, Filename]
FileGetShortcut, LinkFile [, OutTarget, OutDir, OutArgs, OutDescription, OutIcon, OutIconNum, OutRunState]
FileGetSize, OutputVar [, Filename, Units]
FileGetTime, OutputVar [, Filename, WhichTime (M, C, or A -- default is M)]
FileGetVersion, OutputVar [, Filename]
FileInstall, Source, Dest [, Flag (1 = overwrite)]
FileMove, Source, Dest [, Flag (1 = overwrite)]
FileMoveDir, Source, Dest [, Flag (2 = overwrite)]
FileRead, OutputVar, Filename
FileReadLine, OutputVar, Filename, LineNum
FileRecycle, FilePattern
FileRecycleEmpty [, C:\]
FileRemoveDir, Path [, Recurse? (1 = yes)]
FileSelectFile, OutputVar [, Options, RootDir[\DefaultFilename], Prompt, Filter]
FileSelectFolder, OutputVar [, *StartingFolder, Options, Prompt]
FileSetAttrib, Attributes(+-^RASHNOT) [, FilePattern, OperateOnFolders?, Recurse?]
FileSetTime [, YYYYMMDDHH24MISS, FilePattern, WhichTime (M|C|A), OperateOnFolders?, Recurse?]
FormatTime, OutputVar [, YYYYMMDDHH24MISS, Format]
GetKeyState, OutputVar, WhichKey [, Mode (P|T)]
Gosub, Label
Goto, Label
GroupActivate, GroupName [, R]
GroupAdd, GroupName, WinTitle [, WinText, Label, ExcludeTitle, ExcludeText]
GroupClose, GroupName [, A|R]
GroupDeactivate, GroupName [, R]
Gui, sub-command [, Param2, Param3, Param4]
GuiControl, Sub-command, ControlID [, Param3]
GuiControlGet, OutputVar [, Sub-command, ControlID, Param4]
Hotkey, KeyName [, Label, Options]
If (var = "Value") | IfWinExist, WinTitle | etc.`n{`n   command1`n   command2`n}`nElse`n{`n   command1`n   command2`n}
If Var [not] between Low and High
If Var [not] contains value1,value2,...
If Var [not] in value1,value2,...
If Var is [not] integer|float|number|digit|xdigit|alpha|upper|lower|alnum|space|time
IfEqual, var, value
IfExist, File|Dir|Pattern
IfGreater, var, value
IfGreaterOrEqual, var, value
IfInString, Var, SearchString
IfLess, var, value
IfLessOrEqual, var, value
IfMsgBox, Yes|No|OK|Cancel|Abort|Ignore|Retry|Timeout
IfNotEqual, var, value
IfNotExist, File|Dir|Pattern
IfNotInString, Var, SearchString
IfWinActive [, WinTitle, WinText, ExcludeTitle, ExcludeText]
IfWinExist [, WinTitle, WinText, ExcludeTitle, ExcludeText]
IfWinNotActive [, WinTitle, WinText, ExcludeTitle, ExcludeText]
IfWinNotExist [, WinTitle, WinText, ExcludeTitle, ExcludeText]
ImageSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ImageFile
IniDelete, Filename, Section [, Key]
IniRead, OutputVar, Filename, Section, Key [, Default]
IniWrite, Value, Filename, Section, Key
Input [, OutputVar, Options, EndKeys, MatchList]
InputBox, OutputVar [, Title, Prompt, HIDE, Width, Height, X, Y, Font, Timeout, Default]
KeyHistory
KeyWait, KeyName [, Options]
ListHotkeys
ListLines
ListVars
Loop [, Count]`n{`n   ID := A_Index`n   If var%A_Index% =`n   break`n}
Loop, FilePattern [, IncludeFolders?, Recurse?]`n{`n   FileName := A_LoopFileName`n   FileFullPath := A_LoopFileLongPath`n   FileRelativeDir := A_LoopFileDir`n   command2`n}
Loop, Parse, InputVar [, Delimiters|CSV, OmitChars]`n{`n   Line := A_LoopField`n   command2`n}
Loop, Read, InputFile [, OutputFile]`n{`n   Line := A_LoopReadLine`n   command2`n}
Loop, HKLM|HKU|HKCU|HKCR|HKCC [, Key, IncludeSubkeys?, Recurse?]`n{`n   RegName := A_LoopRegName`n   RegType := A_LoopRegType`n   command2`n}
Menu, MenuName, Cmd [, P3, P4, P5]
MouseClick, WhichButton [, X, Y, ClickCount, Speed, D|U, R]
MouseClickDrag, WhichButton, X1, Y1, X2, Y2 [, Speed, R]
MouseGetPos [, OutputVarX, OutputVarY, OutputVarWin, OutputVarControl, 1|2|3]
MouseMove, X, Y [, Speed, R]
MsgBox [, Options, Title, Text, Timeout]
OnExit [, Label]
OutputDebug, Text
Pause [, On|Off|Toggle, OperateOnUnderlyingThread?]
PixelGetColor, OutputVar, X, Y [, Alt|Slow|RGB]
PixelSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ColorID [, Variation, Fast|RGB]
PostMessage, Msg [, wParam, lParam, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
Process, Cmd, PID-or-Name [, Param3]
Progress, Param1 [, SubText, MainText, WinTitle, FontName]
Random, OutputVar [, Min, Max]
RegDelete, HKLM|HKU|HKCU|HKCR|HKCC, SubKey [, ValueName]
RegRead, OutputVar, HKLM|HKU|HKCU|HKCR|HKCC, SubKey [, ValueName]
RegWrite, REG_SZ|REG_EXPAND_SZ|REG_MULTI_SZ|REG_DWORD|REG_BINARY, HKLM|HKU|HKCU|HKCR|HKCC, SubKey [, ValueName, Value]
Reload
Repeat
Return [, Expression]
Run, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]
RunAs [, User, Password, Domain]
RunWait, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]
Send, Keys
SendEvent, Keys
SendInput, Keys

A solution/exemple with ListView: (but in ListView, not retrieve in the combobox)
Code:
 
 Gui, Add, ComboBox, vtFolder gAFFi
 Gui Add, ListView, xm vMyListView , Cmd|N°L
gui, show
return

AFFi:
FileRead, FileList , commands.txt
guicontrolget, tFolder
LV_Delete()

loop , Parse, FileList, `n
    {
    LR = %A_LoopReadLine%
       IfInString, LR, %tFolder%
          {   
             LV_Add("",A_Index, LR )
          }
    }
return


_________________
with ahk, all is different!...<img>
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Thu May 28, 2009 12:05 am    Post subject: Reply with quote

Code:
SplitPath, A_AhkPath,, A_AhkDir
FileRead, Commands, %A_AhkDir%\Extras\Editors\Syntax\Commands.txt
StringReplace, Commands, Commands, |, \, All
StringReplace, Commands, Commands, `r, , All
StringReplace, Commands, Commands, `n,| , All
Gui, Add, ComboBox, w640 R25 Simple AltSubmit vSelected, %commands%
Gui, Show,, %A_AhkDir%\Extras\Editors\Syntax\Commands.txt


Rolling Eyes Question
Back to top
View user's profile Send private message Send e-mail
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Thu May 28, 2009 12:40 am    Post subject: Reply with quote

This is what I'm using. 100% AHK made.



Back to top
View user's profile Send private message
soggos



Joined: 27 Mar 2008
Posts: 129
Location: France

PostPosted: Thu May 28, 2009 8:59 am    Post subject: Reply with quote

SKAN wrote:
Code:
SplitPath, A_AhkPath,, A_AhkDir
FileRead, Commands, %A_AhkDir%\Extras\Editors\Syntax\Commands.txt
StringReplace, Commands, Commands, |, \, All
StringReplace, Commands, Commands, `r, , All
StringReplace, Commands, Commands, `n,| , All
Gui, Add, ComboBox, w640 R25 Simple AltSubmit vSelected, %commands%
Gui, Show,, %A_AhkDir%\Extras\Editors\Syntax\Commands.txt

Smileh yes..it's good...
....i Just want add a hotkey for retrieve the selected line...like
Code:
enter::
guiControlGet, Selected
clipboard := Selected
Return

Question _> but it's retrieve the number of the line, not the Line!
_________________
with ahk, all is different!...<img>
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group