FileOps.$selectdirectory()

Function groupExecute on clientPlatform(s)
FileOpsNOAll

Syntax

FileOps.$selectdirectory(&cPath[,cPrompt,cInitialDirectory,iFlags])

Description

Opens the Select directory dialog. Returns Boolean true if a directory was selected

You can specify the dialog title in cPrompt, and the initial directory in cInitialDirectory.

The iAppflags parameter only applies when running on macOS. It is optional; if specified, it must be a combination of the following constants:

kFileOpsSelectApps Allows applications to be selectable within the dialog
kFileOpsOpenApps Allows the dialog to browse the content of applications

Note that kFileOpsOpenApps automatically implies kFileOpsSelectApps, although it is valid to specify both flags (kFileOpsSelectApps + kFileOpsOpenApps).

The name and full path of the folder selected by the user is returned in cPath. Returns true if the user selected a directory and pressed OK. Otherwise, it returns false, meaning that the user pressed Cancel.

Example

Do
 
FileOps
.
$changeworkingdir
(
sys(
(115))
 
Returns 
lError

Do
 
FileOps
.
$getworkingdir
()
 
Returns 
lWorkDir

Do
 
FileOps
.
$selectdirectory
(
lPath
,
'Select a folder'
,
lWorkDir
)
 
Returns 
lError

# switches to the 'c:\omnis' folder and prompts the user to select a folder