Product Logo

CNS Menu

Dynamic Menus

Functions

CNSMenu_File_SelectWithDialog

NameCNSMenu_File_SelectWithDialog
Description

Presents the user with a standard open file dialog and returns the path to the chosen file.

Return TypeText
FormatCNSMenu_File_SelectWithDialog ( StartPath ; Prompt ; DialogType ; FileTypes )
Optional Parameters
StartPath

The path to the folder to display when the dialog first opens. For “PutFile” dialogs, you can also include a suggested file name.

Prompt

An optional prompt or message to display on the dialog.

DialogType

Specify “GetFile” to show an open file style dialog or “PutFile” to show a save as style dialog. [Default is “GetFile”.]

FileTypes

Specify a list of allowable file extensions for “GetFile” dialogs or a list of optional file extensions for “PutFile” dialogs. [Default is no file types.]

Examples
Example 1

Displays a file chooser dialog, and returns the path of the chosen file.

CNSMenu_File_SelectFileWithDialog
Example 2

Displays a file chooser dialog starting at "images" directory on Windows.

CNSMenu_File_SelectFileWithDialog( "c:\images" )
Example 3

Displays a file chooser dialog starting at "images" folder on Mac.

CNSMenu_File_SelectFileWithDialog( "/Images/" )
Example 4

Displays a file chooser with the prompt "Choose a file...".

CNSMenu_File_SelectFileWithDialog( "" ; "Choose a file..." )