Jump to content

Grabbing List Of Files Selected In Windows Explorer


Recommended Posts

Hi,

I am trying to write an "egg-cracking" script for folders in windows explorer. It will work as follows:

1. User selects some files/folders in win explorer using normal ctrl clicks.

2. User hits hotkey to invoke my autoIt "egg crack" function.

3. Egg-crack function determines which files/folders are currently selected in the active win explorer windows.

4. Egg-crack function loops thru that list, and for any item that is a folder, it moves the contents of that folder into the directory where the folder itself resides, and then deletes the folder. Thus it is as if we are treating all folders as eggs, cracking them open to spill out their contents, and tossing away the shells.

I need help with step 3. Searching I found ProgAndy's script for drag and drop, but there is a lot of code and can't isolate the function that is determining the currently selected files. Can anyone tell me how to do just that step, or which part of Andy's code I should be using.

Thanks,

Jonah

Link to comment
Share on other sites

Compile this to an exe and drag'n'drop things on it.

For $i=1 To $CmdLine[0]
    MsgBox (0, "", $CmdLine[$i])
Next
Thanks for the reply, Inverted. But I don't actually want drag n' drop functionality. I need my script to be able to access the currently selected files in the active windows explorer window. That is, I will be invoking my script by selecting files, then pressing a hotkey, say "F2". It would be incovnenient if I had to select files, and then, say, drag and drop the selected files onto an .exe on the desktop. I only referenced ProgAndays drag n drop script because I thought it might have relevant code. Sorry if that wasn't clear.

Thanks,

Jonah

Link to comment
Share on other sites

If what you want is possible, then I will eat my hat ! :D No way !

I propose an alternative. Press start,run, then enter sendto and press enter. You are at the sendto folder. Copy the compiled script from before here. Now you can select things, right click them, sendto this script. Easiest solution possible I believe. No drag'n'drop , no hotkeys, no script running in the background.

Edited by Inverted
Link to comment
Share on other sites

If what you want is possible, then I will eat my hat ! :D No way !

I propose an alternative. Press start,run, then enter sendto and press enter. You are at the sendto folder. Copy the compiled script from before here. Now you can select things, right click them, sendto this script. Easiest solution possible I believe. No drag'n'drop , no hotkeys, no script running in the background.

Funny you mention that, as it is my current solution using a WSH script + send to. It is surprisingly un-userfriendly, to the point that I decided it would be worth it to figure out how to do this with autoIt and hotkeys.

Also, I am fairly sure that it is IS possible, so prepare to be eating that hat when I find out how! :D

Link to comment
Share on other sites

Here it is:

;Folder "Egg-Crack" tool :) - Idea by @gamingmouse, coding by G.Sandler (MrCreatoR).

#include <File.au3>

Global $iReplaceFiles_Flag = 0

HotKeySet("^+e", "_Egg_Crack_Proc")
HotKeySet("^+w", "_Exit_Proc")

While 1
    Sleep(1000)
WEnd

Func _Exit_Proc()
    Exit
EndFunc

Func _Egg_Crack_Proc()
    $aSelected_Info = _ExplorerGetSelectedItems()
    If @error Then Return -1
    
    For $i = 1 To $aSelected_Info[0][0]
        If $aSelected_Info[$i][1] Then
            $aFiles = _FileListToArray($aSelected_Info[$i][2])
            If @error Then ContinueLoop
            
            For $j = 1 To $aFiles[0]
                $sCurrent_Path = $aSelected_Info[$i][2] & "\" & $aFiles[$j]
                $sDest_Path = $aSelected_Info[$i][2] & "\..\" & $aFiles[$j]
                
                If StringInStr(FileGetAttrib($sCurrent_Path), "D") Then
                    DirMove($sCurrent_Path, $sDest_Path, $iReplaceFiles_Flag)
                Else
                    FileMove($sCurrent_Path, $sDest_Path, $iReplaceFiles_Flag)
                EndIf
            Next
            
            If DirGetSize($aSelected_Info[$i][2]) = 0 Then DirRemove($aSelected_Info[$i][2])
        EndIf
    Next
EndFunc

;[0][0] = Total items count
;[N][0] = Selected element Index
;[N][1] = Selected element is Directory
;[N][2] = Selected element string (full path to the file/dir)
Func _ExplorerGetSelectedItems($sCabinetWClass="[CLASS:CabinetWClass]")
    Local $aRetInfo[1][1]
    Local $aIndexes, $iIndex, $iCount, $sSelected, $sSelected_Path
    Local $hSearch, $sCurrentFile
    
    $sSelected_Path = ControlGetText($sCabinetWClass, "", "Edit1")
    $aIndexes = StringSplit(ControlListView($sCabinetWClass, "", "SysListView321", "GetSelected", 1), "|")
    
    If $aIndexes[0] = 1 And ($aIndexes[1] == "" Or $aIndexes[1] = 0) Then Return SetError(1, 0, 0)
    
    For $i = 1 To $aIndexes[0]
        $sSelected = ControlListView($sCabinetWClass, "", "SysListView321", "GetText", $aIndexes[$i])
        $sCurrentFile = StringRegExpReplace($sSelected_Path, "\\+$", "") & "\" & $sSelected
        
        If Not FileExists($sCurrentFile) Then ;Search the extension for file...
            $hSearch = FileFindFirstFile($sCurrentFile & ".*")
            
            If $hSearch <> -1 Then
                $sCurrentFile = $sSelected_Path & "\" & FileFindNextFile($hSearch)
                FileClose($hSearch)
            EndIf
        EndIf
        
        $aRetInfo[0][0] += 1
        ReDim $aRetInfo[$aRetInfo[0][0]+1][3]
        
        $aRetInfo[$aRetInfo[0][0]][0] = $aIndexes[$i] ;Index
        $aRetInfo[$aRetInfo[0][0]][1] = Number(StringInStr(FileGetAttrib($sCurrentFile), "D") > 0) ;Is Directory
        $aRetInfo[$aRetInfo[0][0]][2] = $sCurrentFile ;Selected file / dir
    Next
    
    If $aRetInfo[0][0] = 0 Then Return SetError(2, 0, 0)
    
    Return $aRetInfo
EndFunc

P.S

Can be problematic in some cases/systems, e.g: when the address bar in explorer is hidden.

Edited by MrCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

If you are just using the active explorer window, why not just send to the clipboard with Send("^c") and then read the clipboard? You'd get the classname for the active window and if it's either CabinetWClass or ExploreWClass then it's explorer. If so, Send("^c") read the clipboard... go through the list and determine which is file and which is folder. Seems though, once you got the selections the rest would be boiler plate.

edit: I don't have AutoIt code to show but I did a hack to use the standard FileOpen Dialog to get folder selections instead of that lame BrowseForFolder thing MS gives. The user selects one or more folders in the FileOpen dialog, then clicks the right mouse button on the window frame while holding down the Alt key. The script just sends ^c to copy to the clipboard and then reads all the filenames(in this case they should be all folders) from the clipboard in a loop. Then it sends the Esc key to close the FileOpen dialog.

It's a hack but there's only so much you can do since they made the FileOpen so that it can't be subclassed(at least not without some arcane programming to insert objects into windows etc.) The hack is much easier. :D

Edited by MilesAhead
Link to comment
Share on other sites

why not just send to the clipboard with Send("^c") and then read the clipboard?

Good idea, done:

;Folder "Egg-Crack" tool :) - Idea by @gamingmouse, coding by G.Sandler (MrCreatoR).
;v0.2

#include <File.au3>

Global $iReplaceFiles_Flag = 0

HotKeySet("^+e", "_Egg_Crack_Proc")
HotKeySet("^+w", "_Exit_Proc")

While 1
    Sleep(1000)
WEnd

Func _Egg_Crack_Proc()
    ClipPut("")
    
    If ControlSend("[CLASS:CabinetWClass]", "", "SysListView321", "^{INSERT}") = 0 Then Return -1
    
    Sleep(100)
    
    Local $sClipGet = ClipGet()
    If $sClipGet == "" Then Return -1
    
    Local $aSelected_Files = StringSplit($sClipGet, @LF)
    Local $aSubFiles, $sCurrent_Path, $sDest_Path
    
    For $i = 1 To $aSelected_Files[0]
        If _PathIsFolder($aSelected_Files[$i]) Then
            $aSubFiles = _FileListToArray($aSelected_Files[$i])
            If @error Then ContinueLoop
            
            For $j = 1 To $aSubFiles[0]
                $sCurrent_Path = $aSelected_Files[$i] & "\" & $aSubFiles[$j]
                $sDest_Path = $aSelected_Files[$i] & "\..\" & $aSubFiles[$j]
                
                If _PathIsFolder($sCurrent_Path) Then
                    DirMove($sCurrent_Path, $sDest_Path, $iReplaceFiles_Flag)
                Else
                    FileMove($sCurrent_Path, $sDest_Path, $iReplaceFiles_Flag)
                EndIf
            Next
            
            If DirGetSize($aSelected_Files[$i]) = 0 Then DirRemove($aSelected_Files[$i])
        EndIf
    Next
EndFunc

Func _PathIsFolder($sPath)
    Return StringInStr(FileGetAttrib($sPath), "D") > 0
EndFunc

Func _Exit_Proc()
    Exit
EndFunc

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

MrCreator, wow! Thank you very much. This is exactly what I wanted. I made 2 minor modifications:

1. store and then replace the original clipboard contents.

2. delete empty folders

I'm reposting just for posterity. Thanks again! I love this forum

;Folder "Egg-Crack" tool smile.gif - Idea by @gamingmouse, coding by G.Sandler (MrCreatoR).
;v0.2

#include <File.au3>
#notrayicon

Global $iReplaceFiles_Flag = 0

HotKeySet("^e", "_Egg_Crack_Proc")
HotKeySet("^+e", "_Exit_Proc")

While 1
    Sleep(1000)
WEnd

Func _Egg_Crack_Proc()
    $origClip = ClipGet()
    ClipPut("")
   
    If ControlSend("[CLASS:CabinetWClass]", "", "SysListView321", "^{INSERT}") = 0 Then Return -1
   
    Sleep(100)
   
    Local $sClipGet = ClipGet()
    If $sClipGet == "" Then Return -1
   
    Local $aSelected_Files = StringSplit($sClipGet, @LF)
    Local $aSubFiles, $sCurrent_Path, $sDest_Path
   
    For $i = 1 To $aSelected_Files[0]
        If _PathIsFolder($aSelected_Files[$i]) Then
            
            ;If the folder is empty, just delete and move on
            If DirGetSize($aSelected_Files[$i]) = 0 Then 
                DirRemove($aSelected_Files[$i])
                ContinueLoop
            EndIf
            
            $aSubFiles = _FileListToArray($aSelected_Files[$i])
            If @error Then ContinueLoop
           
            For $j = 1 To $aSubFiles[0]
                $sCurrent_Path = $aSelected_Files[$i] & "\" & $aSubFiles[$j]
                $sDest_Path = $aSelected_Files[$i] & "\..\" & $aSubFiles[$j]
               
                If _PathIsFolder($sCurrent_Path) Then
                    DirMove($sCurrent_Path, $sDest_Path, $iReplaceFiles_Flag)
                Else
                    FileMove($sCurrent_Path, $sDest_Path, $iReplaceFiles_Flag)
                EndIf
            Next
           
            If DirGetSize($aSelected_Files[$i]) = 0 Then DirRemove($aSelected_Files[$i])
        EndIf
    Next
    ClipPut($origClip)
EndFunc

Func _PathIsFolder($sPath)
    Return StringInStr(FileGetAttrib($sPath), "D") > 0
EndFunc

Func _Exit_Proc()
    Exit
EndFunc
Link to comment
Share on other sites

I made 2 minor modifications:

1. store and then replace the original clipboard contents.

2. delete empty folders

Good idea, but...

1. Replacing the original clipboard content should be performed at the earlier stage, before the function return.

2. Using DirGetSize() to check if the folder is empty is not a good idea after all, on large folders it can slow down the function execution. So we need to build other function to check if the folder contain any files:

;Folder "Egg-Crack" tool :) - Idea by @gamingmouse, coding by G.Sandler (MrCreatoR).
;v0.3

#NoTrayIcon
#include <File.au3>

Global $iReplaceFiles_Flag = 0

HotKeySet("^e", "_Egg_Crack_Proc")
HotKeySet("^+e", "_Exit_Proc")

While 1
    Sleep(1000)
WEnd

Func _Egg_Crack_Proc()
    Local $sOrigin_ClipGet = ClipGet()
    ClipPut("")
    
    If ControlSend("[CLASS:CabinetWClass]", "", "SysListView321", "^{INSERT}") = 0 Then Return ClipPut($sOrigin_ClipGet)
    
    Local $sClipGet = ClipGet()
    Local $iTimer = TimerInit()
    
    While $sClipGet == "" And TimerDiff($iTimer) < 5000 ;wait 5 seconds and continue
        Sleep(10)
        $sClipGet = ClipGet()
    WEnd
    
    ClipPut($sOrigin_ClipGet)
    
    If $sClipGet == "" Then Return -1
    
    Local $aSelected_Files = StringSplit($sClipGet, @LF)
    Local $aSubFiles, $sCurrent_Path, $sDest_Path
    
    For $i = 1 To $aSelected_Files[0]
        If _PathIsFolder($aSelected_Files[$i]) Then
            If _FolderIsEmpty($aSelected_Files[$i], 0) Then ;If the folder is empty, just delete and move on
                DirRemove($aSelected_Files[$i])
                ContinueLoop
            EndIf
            
            $aSubFiles = _FileListToArray($aSelected_Files[$i])
            If @error Then ContinueLoop
            
            For $j = 1 To $aSubFiles[0]
                $sCurrent_Path = $aSelected_Files[$i] & "\" & $aSubFiles[$j]
                $sDest_Path = $aSelected_Files[$i] & "\..\" & $aSubFiles[$j]
                
                If _PathIsFolder($sCurrent_Path) Then
                    DirMove($sCurrent_Path, $sDest_Path, $iReplaceFiles_Flag)
                Else
                    FileMove($sCurrent_Path, $sDest_Path, $iReplaceFiles_Flag)
                EndIf
            Next
            
            If _FolderIsEmpty($aSelected_Files[$i], 0) Then DirRemove($aSelected_Files[$i])
        EndIf
    Next
EndFunc

Func _FolderIsEmpty($sPath, $iCheckIfExist = 1)
    If $iCheckIfExist And Not _PathIsFolder($sPath) Then Return SetError(1, 0, 0)
    
    Local $hSearch = FileFindFirstFile($sPath & "\*")
    Local $iRet = @error
    
    FileClose($hSearch)
    
    Return $iRet
EndFunc

Func _PathIsFolder($sPath)
    Return StringInStr(FileGetAttrib($sPath), "D") > 0
EndFunc

Func _Exit_Proc()
    Exit
EndFunc
Edited by MrCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

MrCreator,

Nice catches! Thanks. I have one other question. I've been using this technique to collect selected filenames in another script I'm working on, and the first Sleep(100) -- about 5 lines into the egg crack proc -- needs to be changed to sleep(400) for at least one folder I have (it has about 25 large video files with long names). If I don't increase the sleep, then the line:

If $sClipGet == "" Then Return -1

returns. What is going on here? Is there anyway to avoid this issue? One other bizarre fact is that if I add an empty folder beside the video files, then everything works fine with Sleep(100).

Thanks,

Jonah

Link to comment
Share on other sites

We can loop untill the ClipGet <> "". Changed in my last post.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Perfect!

Out of curiosity, if we ignore simplicity, do you think your original solution to get selected filenames, or this new clipboard method, is better?

Also, I used this technique to create a utility where you can hotkey a dialog box with a "find" and "replace" field, and then do a regex replace. It will loop through all selected files, and rename them according to your find/replace. So you can get rid of filename prepends/appends, or add them yourself, etc... If you are interested I can upload it.

Thanks again for help

Jonah

Link to comment
Share on other sites

Out of curiosity, if we ignore simplicity, do you think your original solution to get selected filenames, or this new clipboard method, is better?

I think the Clipboard method is more reliable, but less preferable (because of clipboard usage).

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...