savedialog Reference

Open a dialog asking for a filename

savedialog

Description

Opens a file dialog for selection or entry of a filename to write. savedialog takes a list of one or more file types and allows you to save a file and choose a type for it.

Examples

Select a folder or a specific file type for file saving

Discussion

To choose a folder, use the "fold" type. savedialog reports the entire pathname of the file or folder chosen, which can be passed to any Max object after the word write or save.

Arguments

filetypes [symbol]

Optional

Sets one or more file types that will be displayed as choices for the user. The symbol fold specifies that the dialog box should let the user choose only folders.

Attributes

Common Box Attributes

Messages

bang

Causes a standard Save As dialog box to appear, allowing the user to type in a filename and choose a folder location. The resulting location and filename are output as a symbol.

anything

Arguments

filetype [list]
One or more four-letter filetype codes sets the list of types displayed in the dialog box. Example type codes for files are TEXT for text files, maxb for Max binary format patcher files, and AIFF for AIFF format audio files. The symbol fold specifies that the dialog box should let the user choose only folders.

name

Arguments

filename [symbol]
The word name, followed by a symbol, specifies a default file name.

set

Arguments

filetype [list]
The word set, followed by a four-letter filetype codes, sets the savedialog object to display the desired file type without opening the dialog box. The chosen file type is sent out the middle outlet when the user chooses Save in the dialog box.

Output

bang

Out right outlet: If the user chooses Cancel in the dialog box, a bang is sent out.

symbol

Out left outlet: The absolute pathname of the file as a symbol. The output pathnames contain slash separators.

Absolute pathnames look like this:

"C:/Max Folder/extras/mystuff/mypatch.pat"

The conformpath object can be used to convert paths of one pathtype and/or pathstyle to another.

symbol

Out middle outlet: The four-letter filetype code which specifies the filetype currently selected.

See Also

Name Description
conformpath
dialog
filedate
filein
filepath
opendialog