Jump to content

FileSelectFolder


Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

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?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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
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...