---
title: "write(toFile:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolorlist/write(tofile:)"
---

# write(toFile:)

Saves the color list to the file at the specified path.

## Declaration

```swift
func write(toFile path: String?) -> Bool
```

## Parameters

- `path`: The path at which to save the color list. If path is a directory, the receiver is saved in a file named listname.clr in that directory (where listname is the name with which the receiver was initialized). If path includes a filename, this method saves the file under that name. If path is nil, the file is saved as listname.clr in the user’s private colorlists directory.

## Return Value

Return Value true upon success and false if the method fails to write the file.

## See Also

### Writing and Removing Color List Files

- [write(to:)](appkit/nscolorlist/write(to:).md)
- [removeFile()](appkit/nscolorlist/removefile().md)
