Digisoul Posted September 23, 2008 Share Posted September 23, 2008 Hello every one,2day is my really bad day, i m trying to find 1 function which can return the file path if user click on any file in Explorer.I am really fed-up to see that there is no any proper Script in Whole Forum?????Please Guys its my request; show me any proper rite path ? or tell me its possible with AutoIt or not ????Please Its Request. 73 108 111 118 101 65 117 116 111 105 116 Link to comment Share on other sites More sharing options...
monoceres Posted September 23, 2008 Share Posted September 23, 2008 (edited) I was unable to get the file extension >_<http://www.autoitscript.com/forum/index.php?showtopic=80054Edit: Sorry, to quick on the button there. You can always use Send("^c") and then use ClipGet() to get the full path Edited September 23, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 23, 2008 Moderators Share Posted September 23, 2008 Hello every one,2day is my really bad day, i m trying to find 1 function which can return the file path if user click on any file in Explorer.I am really fed-up to see that there is no any proper Script in Whole Forum?????Please Guys its my request; show me any proper rite path ? or tell me its possible with AutoIt or not ????Please Its Request.The files in the Explorer or on the Desktop are in a ListView. Using a combination of the _GUICtrlListView* functions along with some custom conversions for mouse position to client coords etc... and you could achieve it. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Digisoul Posted September 24, 2008 Author Share Posted September 24, 2008 (edited) The files in the Explorer or on the Desktop are in a ListView. Using a combination of the _GUICtrlListView* functions along with some custom conversions for mouse position to client coords etc... and you could achieve it.Thanks for your Reply Guys,Can you please Give me any example i already tried that all, some of my functions takes much CPU, if i use Sleep then, time problem; & if i use FileFind function, it give me 2 files; e.g: 123.exe, 123.jpg.Is'nt there any other trick ? I reay Feel HELL, when some programs do that things. Edited September 24, 2008 by Digisoul 73 108 111 118 101 65 117 116 111 105 116 Link to comment Share on other sites More sharing options...
Digisoul Posted September 24, 2008 Author Share Posted September 24, 2008 I was unable to get the file extension >_<http://www.autoitscript.com/forum/index.php?showtopic=80054Edit: Sorry, to quick on the button there. You can always use Send("^c") and then use ClipGet() to get the full path I already watched your script, there is a 1 bug i found, The script take much CPU, if the folder hav huge criteria of files.and 2ndly i want to use this script in loop structure, so Send("^c") will never pass the path in required time. 73 108 111 118 101 65 117 116 111 105 116 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 24, 2008 Moderators Share Posted September 24, 2008 Thanks for your Reply Guys,Can you please Give me any example i already tried that all, some of my functions takes much CPU, if i use Sleep then, time problem; & if i use FileFind function, it give me 2 files; e.g: 123.exe, 123.jpg.Is'nt there any other trick ? I reay Feel HELL, when some programs do that things. Yeah... that's not how it works here. You ask a question, we give you specifics to look for. You provide code you've attempted to write on your own and we give you specifics to look for and or help you with the code you've attempted. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Digisoul Posted September 24, 2008 Author Share Posted September 24, 2008 (edited) Yeah... that's not how it works here. You ask a question, we give you specifics to look for. You provide code you've attempted to write on your own and we give you specifics to look for and or help you with the code you've attempted.Here Is My Code , so please help me out expandcollapse popup#include <WINAPI.au3> #include <Process.au3> #include <GUIListView.au3> #include <Array.au3> Global $old, $new, $dek = @DesktopDir, $docs = @MyDocumentsDir, $state = True, $found_files[1] = [""], $get = False,$founded[1] Global $i, $handle, $chandle, $item, $path While 1 Sleep(80) If WinActive("[CLASS:CabinetWClass]") Then $stop = ControlGetText($handle, "", 41477) Switch $stop Case "My Computer", "Control Panel" Case Else $handle = WinGetHandle("[CLASS:CabinetWClass]") $chandle = ControlGetHandle($handle, "", "[CLASSNN:SysListView321]") getfiles() EndSwitch EndIf WEnd Func getfiles() $array_index = _GUICtrlListView_GetSelectedIndices($chandle, True) For $i = 0 To $array_index[0] $item = _GUICtrlListView_GetItemText($chandle, $array_index[$i]) $path = ControlGetText($handle, "", 41477) _ReduceMemory(@AutoItPID) Switch $path Case "My Computer", "Control Panel" ConsoleWrite("Invaild Paths") Case Else $f_hand = FileFindFirstFile($path & "\" & $item & ".*") While 1 Sleep(70) $found = FileFindNextFile($f_hand) If @error Then ExitLoop If Not StringInStr(FileGetAttrib($path & "\" & $found), "D", 2) Then $marking = _ArrayFindAll($founded, $path & "\" & $found) If $marking = -1 Then _ArrayAdd($found_files, $path & "\" & $found) $get = True EndIf EndIf WEnd If $get = True Then getfile() EndIf EndSwitch ;~ EndIf Next EndFunc;==>getfiles Func getfile() ;~ MsgBox(0, UBound($found_files), UBound($found_files) - 1) If UBound($found_files) - 1 <> 0 Then For $i2 = 0 To UBound($found_files) - 1 If $found_files[$i2] <> "" Then ConsoleWrite("> File Is " & $found_files[$i2] & @CRLF) _ArrayAdd($founded, $found_files[$i2]) EndIf Next ; Reset ARRAY $found_files = 0 Dim $found_files[1] = [""] $get = False EndIf EndFunc;==>getfile Edited September 24, 2008 by Digisoul 73 108 111 118 101 65 117 116 111 105 116 Link to comment Share on other sites More sharing options...
DaRam Posted September 24, 2008 Share Posted September 24, 2008 To have proper control, ideally - you would put up your own file list and capture the selections.If you are using Vista, and hold down the shift key when you right-click a file in Explorer, the extended context pop-up menu will present the a "Copy as Path" option.Pre-Vista, look at http://technet.microsoft.com/en-us/library/cc751394.aspxi m trying to find 1 function which can return the file path if user click on any file in Explorer. Link to comment Share on other sites More sharing options...
Digisoul Posted September 24, 2008 Author Share Posted September 24, 2008 (edited) To have proper control, ideally - you would put up your own file list and capture the selections.If you are using Vista, and hold down the shift key when you right-click a file in Explorer, the extended context pop-up menu will present the a "Copy as Path" option.Pre-Vista, look at http://technet.microsoft.com/en-us/library/cc751394.aspxThank you very much for your Reply DaRam, But your sugustions never full fill ma requirements. & i am using Win XP Edited September 24, 2008 by Digisoul 73 108 111 118 101 65 117 116 111 105 116 Link to comment Share on other sites More sharing options...
Digisoul Posted September 25, 2008 Author Share Posted September 25, 2008 Hello Guys No Reply At All ???????????????? 73 108 111 118 101 65 117 116 111 105 116 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 25, 2008 Moderators Share Posted September 25, 2008 Hello Guys No Reply At All ????????????????You're not asking for a reply, you're asking someone to write something for you. If they chose to do so, they will do it in their own time frame. The question marks after the request is rediculous!!!!!!! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Digisoul Posted September 27, 2008 Author Share Posted September 27, 2008 You're not asking for a reply, you're asking someone to write something for you. If they chose to do so, they will do it in their own time frame. The question marks after the request is rediculous!!!!!!!Thanks for your kind Reply Sir. 73 108 111 118 101 65 117 116 111 105 116 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now