<div class="meta" robots="noindex">

</div>

Method

# GetSaveFolderItem

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `FolderItem.ShowSaveFileDialog<folderitem.showsavefiledialog>` as a replacement.

</div>

## Description

Used to present the standard Save As dialog box to the user.

## Usage

*result*=**GetSaveFolderItem**(*filter*, *default file name*)

| Part              | Type                                | Description                                                                                                                         |
|-------------------|-------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| result            | `FolderItem</api/files/folderitem>` | Represents the file the user wants to create.                                                                                       |
| filter            | `String</api/data_types/string>`    | The file type to be assigned to the file, as defined in the File Type Sets Editor or via the `FileType</api/files/filetype>` class. |
| default file name | `String</api/data_types/string>`    | The name that should appear by default in the Save As dialog box.                                                                   |

## Notes

The <span class="title-ref">GetSaveFolderItem</span> function displays the standard Save As file dialog box, allowing the user to choose a location and enter a name for the file to be saved. The `SaveFileDialog</api/user_interface/desktop/savefiledialog>` class provides the same functionality but allows for customization.

The <span class="title-ref">GetSaveFolderItem</span> function does not create the file. It returns a `FolderItem</api/files/folderitem>` that represents the potential file. To create the actual file, you will need to call or Create shared method for `TextOutputStream</api/files/textoutputstream>` or the Create shared method of the `BinaryStream</api/files/binarystream>`.

The filter should either be an empty string or the name of a file type as defined in the File Type Sets Editor or via the `FileType</api/files/filetype>` class.

On macOS, a Hide Filename Extension checkbox appears in the save-file dialog. The `FolderItem</api/files/folderitem>` returned has its ExtensionVisible property set according to the user's use of this checkbox.

## Sample code

This example displays the save as file dialog box. The File Type referred to by <span class="title-ref">GetSaveFolderItem</span> declares the common file type "text/plain", which you will first want to add to your project using the File Type Sets Editor.

A text file is then created and the text properties of three `TextFields</api/deprecated/textfield>` are written to the new file. Finally the file is closed.

``` xojo
Dim f As FolderItem
Dim fileStream As TextOutputStream
f = GetSaveFolderItem(FileTypes1.Text, "MyInfo")
If f <> Nil Then
  fileStream = TextOutputStream.Create(f)
  fileStream.WriteLine(NameField.Text)
  fileStream.WriteLine(AddressField.Text)
  fileStream.WriteLine(PhoneField.Text)
  fileStream.Close
End If
```

## Compatibility

All project types on all supported operating systems.

## See also

`FolderItem.ShowOpenFileDialog<folderitem.showopenfiledialog>`, `FolderItem.ShowSelectFolderDialog<folderitem.showselectfolderdialog>` functions; `FileType</api/files/filetype>`, `FolderItem</api/files/folderitem>`, `FolderItemDialog</api/user_interface/desktop/folderitemdialog>`, `SaveFileDialog</api/user_interface/desktop/savefiledialog>` classes.
