Get open filenames ext: Difference between revisions

From ENIGMA
Jump to navigation Jump to search
 
Line 7: Line 7:
! Parameter !! Description
! Parameter !! Description
|-
|-
| ''filter'' || The file filters to use. The OsaScript widget systems only supports one file filter, but each file filter can support multiple masks.
| ''filter'' || The file filters to use.
|-
|-
| ''fname'' || The default filename to display in the dialog's text box. Can also be a directory if you want the dialog to open to a specific folder on initialization.
| ''fname'' || The default filename to display in the dialog's text box.
|-
|-
| ''dir'' || The default directory to display when the dialog has initialized, if fname lists a file name and not a directory.
| ''dir'' || The default directory to display when the dialog has initialized.
|-
|-
| ''title'' || The title of the dialog box in the window caption.
| ''title'' || The title of the dialog box in the window caption.

Latest revision as of 01:09, 19 February 2019

Description

Displays an multi-select "open file" dialog box. filter has the form 'name1|mask1|name2|mask2a;mask2b' where a typical mask is '*.ext'.

Parameters

Parameter Description
filter The file filters to use.
fname The default filename to display in the dialog's text box.
dir The default directory to display when the dialog has initialized.
title The title of the dialog box in the window caption.

Return Values

string: Returns the selected absolute path and file name to every file selected, separated by a new line.

Example Call

// This example prompts the user to select sprite images and displays a message box with the files selected as the message. Errors on cancel. 
fnames = get_open_filename_ext("Supported Sprite Image Formats (*.png *.jpg *.jpeg *.gif)|*.png;*.jpg;*.jpeg;*.gif", "", working_directory, "Select Sprite Image Files");
if (fnames != "") {
  show_message(fnames);
} else {
  show_error("No files selected!", false);
}