Jump to content
trashy

FileSelectFolder

Recommended Posts

trashy

I am using FileSelectFolder to select a folder and save multiple files to it.

Is there an easy way to display All content, Files and folders. I don't need to select a file I just need users to see folder content before saving.

Share this post


Link to post
Share on other sites
JLogan3o13

So you want to see what: a boolean yes/no if the folder contains files?, number of files in each folder?, names of files in folder?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
trashy

I need any and all files to be displayed in FileSelectFolder window. Some of the files I'm adding, saving to this folder are new some are intended to over write existing files. If files are visible in FileSelectFolder it will help users decide if they have the correct folder.

Share this post


Link to post
Share on other sites
Subz

Can't you use FileOpenDialog?  Then just remove the filename to get the folder directory?

Share this post


Link to post
Share on other sites
Melba23

trashy,

My ChooseFileFolder UDF (look in my sig for the link) will let you display both files and folders but as you can distinguish between them when selected you should be able to get just a folder name even if the user actually goes for a file.

M23

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
trashy

I was thinking use ShellExecute and open folder in explorer to view content before saving, or _FileListToArrayRec and view in a listbox.

@Subz that would be another easy work around

@ Melba23 I looked at it briefly already, it has a lot of features to consider, I need to spend more time with it.

I was hoping for something I was already familiar with. Ran into this before and it's not that big of a deal it would just be nice to view all folder content in FileSelectFolder dialog window. Phone keeps ringing I can't even finish a simple reply.

 

Share this post


Link to post
Share on other sites
trashy

Using FileSelectFolder to set directory to save multiple files. Is it possible to view not select files and not just folders.

This isn't really a solution but it is a nice easy little work around, a little insurance.

You could easily compare files to existing but that's more than I needed for this situation

#include <File.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

Global $SaveTex = FileSelectFolder("SaveFiles", @ScriptDir)
_Example()
Func _Example()
If @error Then
    Return
Else
    $FileList = _FileListToArray($SaveTex, '*.*', 1) ;Add your file extension *.txt

    If $FileList = "0" Then
        ;Add your function here
    Else
        $ListGui = GUICreate("Contents", 200, 200, -1, -1, -1, $WS_EX_ACCEPTFILES)
        $Butt1 = GUICtrlCreateButton("yes", 5, 170, 65, 25)
        $Butt2 = GUICtrlCreateButton("no", 130, 170, 65, 25)
        GUICtrlCreateLabel("Selected Folder Containes these files", 10, 5, 250, 24)
        GUICtrlCreateLabel("Files will be Updated/Over Written", 10, 120, 250, 24)
        GUICtrlCreateLabel("Do You Wish to Continue", 10, 140, 250, 24)
        $lstmain = GUICtrlCreateList("", 0, 20, 200, 100)
        For $n = 1 To UBound($FileList) - 1
            $File_Name = $FileList[$n]
            GUICtrlSetData($lstmain, $File_Name)
        Next
        GUISetState()
        While 1
            $nMsg = GUIGetMsg()
            Switch $nMsg
                Case $GUI_EVENT_CLOSE, $Butt2
                    GUIDelete($ListGui)
                    Return
                Case $Butt1
                    ;Add Your Function Here
                    GUIDelete($ListGui)
                    Return
            EndSwitch
        WEnd
    EndIf
EndIf
EndFunc

Share this post


Link to post
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

×