---
title: lastComponentOfFileName
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsdocument/lastcomponentoffilename
---

# lastComponentOfFileName

The name of the document seen by the user in AppleScript.

## Declaration

```swift
var lastComponentOfFileName: String { get set }
```

## Discussion

Discussion This property contains the document name used during scripting. Note that this name may be different than the name used in fileURL.

## See Also

### Related Documentation

- [displayName](appkit/nsdocument/displayname.md)

### Handling Script Commands

- [handleClose(_:)](appkit/nsdocument/handleclose(_:).md)
- [handlePrint(_:)](appkit/nsdocument/handleprint(_:).md)
- [handleSave(_:)](appkit/nsdocument/handlesave(_:).md)
- [objectSpecifier](appkit/nsdocument/objectspecifier.md)
