Get_save_filename_ext - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

Description

Displays an "save file as" 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. Some widget systems only support one filter, such as OsaScript and KDailog. Each file filter can support multiple masks.
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.
dir The default directory to display when the dialog has initialized, if fname lists a file name and not a directory.
title The title of the dialog box in the window caption.

Return Values

string: Returns the selected absolute path and file name.

Example Call

// This example prompts the user to select an absolute path and file name, and then takes a screenshot. Errors on cancel.
fname = get_save_filename_ext("Supported Screenshot Formats (*.png)|*.png", "screenshot.png", working_directory, "Save Screenshot Image File");
if (fname != "") {
  screen_save(fname);
} else {
  show_error("File not saved!", false);
}

NOTOC