Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSSavePanelMBS class.

NSSavePanelMBS.allowedFileTypes as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns an array of the allowed file types.

If the user specifies a file whose type is in the array of allowed types, the user is not presented with another dialog (see allowsOtherFileTypes for details about this dialog) when trying to save. Examples of common file types are "rtf", "tiff", and "ps". File type strings encoding HFS file types are not valid values for this attribute. A nil return value, which is the default, indicates that the user can save to any ASCII file.

Available in Mac OS X v10.3 and later.

NSSavePanelMBS.beginSheetForDirectory(path as folderitem, name as string, targetWindow as DesktopWindow)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 22.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Presents a Save panel as a sheet with the directory specified by path and optionally, the file specified by name selected.

If targetWindow is nil, the panel will be a modal dialog.

This method will later called the savePanelDidEnd event.

Seems like on Mac OS X 10.4 the usage of sheets will raise NSExceptions for missing methods in the NSCarbonWindowFrame class.

See also:

NSSavePanelMBS.beginSheetForDirectory(path as folderitem, name as string, targetWindow as window)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Presents a Save panel as a sheet with the directory specified by path and optionally, the file specified by name selected.

If targetWindow is nil, the panel will be a modal dialog.

This method will later called the savePanelDidEnd event.

Seems like on Mac OS X 10.4 the usage of sheets will raise NSExceptions for missing methods in the NSCarbonWindowFrame class.

See also:

NSSavePanelMBS.Cancel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
You can cancel the dialog using this method.

NSSavePanelMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The constructor which initializes the panel with default values.

NSSavePanelMBS.File as folderitem

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The file currently shown in the panel.

May be nil.

NSSavePanelMBS.HideNSNavNodePopUpButton

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 8.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Hides the nagivation popup menu.

This is a function using undocumented features from the Apple NSSavePanel class, so there is not guarantee that it will work in future versions.

NSSavePanelMBS.Ok

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
You can click ok in the dialog using this method.

NSSavePanelMBS.runModal as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Displays the panel and begins its event loop with the current working (or last selected) directory as the default starting point.
Example

dim n as new NSSavePanelMBS

dim e as integer = n.runModal

if e = n.NSCancelButton then
// cancelled
Break
elseif e = n.NSOKButton then
// got file
dim file as FolderItem = n.file
Break
end if

Returns NSOKButton or NSCancelButton or -1 on any error.

NSSavePanelMBS.runModalForDirectory(path as folderitem, name as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Initializes the panel to the directory specified by path and, optionally, the file specified by filename, then displays it and begins its modal event loop; path and filename can be empty strings.

If path is nil, the previous directory the Save panel was in is used.
See NSCancelButton and NSOkButton constants for return values.

NSSavePanelMBS.setAllowedFileTypes(filetype as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A convenience method for setAllowedFileTypes with only one file type.

See also:

Some examples using this method:

NSSavePanelMBS.setAllowedFileTypes(filetypes() as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Specifies the allowed file types.

A file type is an extension to be appended to any selected files that don't already have that extension; "nib" and "rtf" are examples. The items in types should not include the period that begins the extension. File type strings encoding HFS file types are not valid values. Pass an empty array, to allow any file type, which is the default.

See also:

NSSavePanelMBS.setTagNames(tagNames() as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 23.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the tag names that you want to include on a saved file.
Example

dim n as new NSSavePanelMBS
n.showsTagField = true
n.setTagNames array("test")

When the value of showsTagField is true, use this property to provide an array of strings that represent the initial tag names to display in the panel. If you set the property to nil or an empty array, the panel displays no initial tag names.

NSSavePanelMBS.tagNames as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 23.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The tag names that you want to include on a saved file.

When the value of showsTagField is true, use this property to provide an array of strings that represent the initial tag names to display in the panel. If you set the property to nil or an empty array, the panel displays no initial tag names.

NSSavePanelMBS.validateVisibleColumns

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Navigation MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Validates and possibly reloads the browser columns visible in the receiver by invoking the delegate method shouldShowFilename.

You might use this method if you want the browser to only allow selection of files with certain extensions based on the selection made in an accessory-view pop-up list. When the user changes the selection, you would invoke this method to revalidate the visible columns.

The items on this page are in the following plugins: MBS MacCocoa Plugin.


The biggest plugin in space...