Does anybody know If its possible to display the file name but pass the paths as the value to the final output?
I was thinking of maybe doing a multi-column list with both Filepath and File name and hidding the paths from view. Don't know if that is even possible.
Also in windows7 I get permission denied runtime error:70 when selecting some folders?
Code: Select all
vbstart
dim recursion
Set FSO = CreateObject("Scripting.FileSystemObject")
Sub ShowSubFolders(path)
set Folder = FSO.GetFolder(path)
For Each Subfolder in Folder.SubFolders
recursion = recursion&Subfolder.Path&vbcrlf
ShowSubFolders Subfolder
Next
End Sub
VBEND
let>Selected_files=
Let>ext=*
Dialog>MultiSelect
object MultiSelect: TForm
Left = 247
Top = 96
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 420
ClientWidth = 848
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 25
Width = 521
Height = 395
Align = alLeft
Caption = 'Panel1'
TabOrder = 0
ExplicitHeight = 497
object Splitter1: TSplitter
Left = 226
Top = 1
Width = 7
Height = 393
MinSize = 100
ResizeStyle = rsUpdate
ExplicitHeight = 495
end
object MSListBox1: tMSListBox
Left = 1
Top = 1
Width = 225
Height = 393
Align = alLeft
BevelKind = bkFlat
ItemHeight = 13
Sorted = True
TabOrder = 0
SelectedIndex = -1
ExplicitHeight = 554
end
object MSListBox2: tMSListBox
Left = 233
Top = 1
Width = 287
Height = 393
Align = alClient
ItemHeight = 13
MultiSelect = True
TabOrder = 1
SelectedIndex = -1
end
end
object Panel3: TPanel
Left = 577
Top = 25
Width = 271
Height = 395
Align = alClient
AutoSize = True
Caption = 'Panel3'
TabOrder = 1
ExplicitLeft = 576
ExplicitWidth = 288
ExplicitHeight = 556
object MSListBox3: tMSListBox
Left = 1
Top = 1
Width = 269
Height = 393
Align = alClient
BevelKind = bkFlat
ItemHeight = 13
MultiSelect = True
TabOrder = 0
SelectedIndex = -1
end
end
object Panel2: TPanel
Left = 0
Top = 0
Width = 848
Height = 25
Align = alTop
TabOrder = 2
object Label1: TLabel
Left = 48
Top = 8
Width = 68
Height = 13
Caption = 'Select a folder'
end
object Label2: TLabel
Left = 288
Top = 8
Width = 63
Height = 13
Caption = 'File Selection'
end
object Label3: TLabel
Left = 664
Top = 8
Width = 29
Height = 13
Caption = 'myList'
end
object MSButton7: tMSButton
Left = 147
Top = 3
Width = 54
Height = 20
Caption = 'Browse'
TabOrder = 0
DoBrowse = False
InitialDir = '"c:\"'
BrowseStyle = fbFolder
end
end
object Panel4: TPanel
Left = 521
Top = 25
Width = 56
Height = 395
Align = alLeft
TabOrder = 3
object MSButton1: tMSButton
Left = 12
Top = 95
Width = 29
Height = 25
Caption = '->'
TabOrder = 0
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton2: tMSButton
Left = 12
Top = 137
Width = 29
Height = 25
Caption = '<-'
TabOrder = 3
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton3: tMSButton
Left = 12
Top = 221
Width = 27
Height = 25
Caption = 'CLR'
TabOrder = 1
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton4: tMSButton
Left = 12
Top = 179
Width = 27
Height = 25
Caption = 'CLN'
TabOrder = 2
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton5: tMSButton
Left = 12
Top = 263
Width = 33
Height = 25
Caption = 'UP'
TabOrder = 4
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton6: tMSButton
Left = 12
Top = 305
Width = 37
Height = 25
Caption = 'DWN'
TabOrder = 5
DoBrowse = False
BrowseStyle = fbOpen
end
end
end
EndDialog>MultiSelect
SRT>DoBrowse
SetDialogProperty>MultiSelect,MSButton7,DoBrowse,True
GetDialogProperty>MultiSelect,MSButton7,Filename,path
vbrun>ShowSubFolders,%path%
vbeval>recursion,hFList
SetDialogProperty>MultiSelect,MSListBox1,Text,%hFList%
END>DoBrowse
AddDialogHandler>MultiSelect,MSListBox1,OnClick,FolderSelect
AddDialogHandler>MultiSelect,MSButton1,OnClick,FileAdd
AddDialogHandler>MultiSelect,MSButton2,OnClick,FileRem
AddDialogHandler>MultiSelect,MSButton3,OnClick,ClearList
AddDialogHandler>MultiSelect,MSButton4,OnClick,CleanList
AddDialogHandler>MultiSelect,MSButton5,OnClick,Move_Up
AddDialogHandler>MultiSelect,MSButton6,OnClick,Move_Down
AddDialogHandler>MultiSelect,MSButton7,OnClick,DoBrowse
Show>MultiSelect,r
// Do Somethin with the list
Messagemodal>Do Somethin with myList%CRLF%%CRLF%%Selected_files%
Exit
SRT>CleanList
StringReplace>%Selected_files%,--removed--%CRLF%,,Selected_files
SetDialogProperty>MultiSelect,MSListBox3,Text,Selected_files
END>CleanList
SRT>ClearList
let>Selected_files=
SetDialogProperty>MultiSelect,MSListBox3,Text,Selected_files
END>ClearList
SRT>FileRem
GetDialogProperty>MultiSelect,MSListBox3,SelectedItems,remfile_list
Separate>Selected_files,CRLF,selected_items
GetDialogProperty>MultiSelect,MSListBox3,SelectedIndex,rn
Separate>remfile_list,CRLF,rem_items
let>re=0
Repeat>re
let>re=re+1
StringReplace>%Selected_files%,rem_items_%re%,--removed--,Selected_files
Until>re,rem_items_count
SetDialogProperty>MultiSelect,MSListBox3,Text,Selected_files
END>FileRem
SRT>FileAdd
GetDialogProperty>MultiSelect,MSListBox2,SelectedItems,file_list
let>Selected_files=%file_list%%CRLF%%Selected_files%
SetDialogProperty>MultiSelect,MSListBox3,Text,Selected_files
END>FileAdd
SRT>FolderSelect
GetDialogProperty>MultiSelect,MSListBox1,SelectedItems,Selected_list
Separate>Selected_List,CRLF,selected_items
Let>GFL_TYPE=0
GetFileList>%selected_items_1%\*.%ext%,theList,CRLF
SetDialogProperty>MultiSelect,MSListBox2,Text,theList
END>FolderSelect
SRT>Move_Up
SetDialogProperty>MultiSelect,MSListBox3,MultiSelect,False
GetDialogProperty>MultiSelect,MSListBox3,SelectedIndex,rn
If>%rn%=0
Goto>end_of_up_sub
Else
GetDialogProperty>MultiSelect,MSListBox3,SelectedItems,rvo
Let>rn=%rn%-1
GoSub>swapItem
Endif
Label>end_of_up_sub
SetDialogProperty>MultiSelect,MSListBox3,MultiSelect,True
END>Move_Up
SRT>Move_Down
SetDialogProperty>MultiSelect,MSListBox3,MultiSelect,False
GetDialogProperty>MultiSelect,MSListBox3,SelectedIndex,rn
If>%rn%=-1
Goto>end_of_down_sub
else
GetDialogProperty>MultiSelect,MSListBox3,SelectedItems,rvo
Let>rn=%rn%+1
GoSub>swapItem
Endif
Label>end_of_down_sub
SetDialogProperty>MultiSelect,MSListBox3,MultiSelect,True
END>Move_Down
SRT>swapItem
SetDialogProperty>MultiSelect,MSListBox3,SelectedIndex,%rn%
GetDialogProperty>MultiSelect,MSListBox3,SelectedItems,rvn
StringReplace>%Selected_files%,%rvo%,Rp1,Selected_files
StringReplace>%Selected_files%,%rvn%,%rvo%,Selected_files
StringReplace>%Selected_files%,Rp1,%rvn%,Selected_files
SetDialogProperty>MultiSelect,MSListBox3,Text,%Selected_files%
SetDialogProperty>MultiSelect,MSListBox3,SelectedIndex,%rn%
END>swapItem