FileOps.$selectdirectory()

Function group Execute on client Platform(s)
FileOps NO All

Syntax

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

Description

Opens the Select folder dialog.

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. Pathnames can be over 255 characters, which was the limit in Studio 8.0.1 or earlier. The function 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