Dim fc As FileChooser
fc.Initialize
fc.Title = "Select a Directory (Open any file within the directory)"
Dim selectedFile As String
selectedFile = fc.ShowOpen(MainForm)
If selectedFile <> "" Then
Dim directoryPath As String
directoryPath = File.GetFileParent(selectedFile)
Log("Selected Directory: " & directoryPath)
' You can now use the selected directory path
Else
Log("No file selected.")
End If