# Show Save Changes Dialog Before Closing A Document

**URL:** <https://forums.creativeclouddeveloper.com/t/show-save-changes-dialog-before-closing-a-document/3380>\
**Category:** UXP Plugin API\
**Created:** [July 26, 2021, 1:15pm UTC](https://forums.creativeclouddeveloper.com/t/show-save-changes-dialog-before-closing-a-document/3380 "2021-07-26T13:15:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IanBarber](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@IanBarber](https://forums.creativeclouddeveloper.com/u/IanBarber)\
**Post date:** [July 26, 2021, 1:15pm UTC](https://forums.creativeclouddeveloper.com/t/show-save-changes-dialog-before-closing-a-document/3380/1 "2021-07-26T13:15:15Z")

</div>

Does any one know how to Show the _Save Changes Dialog_ Before Closing A Document

 ![Screenshot 2021-07-26 134002](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/b/b8df12a11983e3fce5bfba08df0ad5e0594c00dc.jpeg)

Thanks

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [July 26, 2021, 2:48pm UTC](https://forums.creativeclouddeveloper.com/t/show-save-changes-dialog-before-closing-a-document/3380/2 "2021-07-26T14:48:43Z")

</div>

You have two options:

- with DOM  
`app.activeDocument.close()`
- with batchPlay

```auto
psCore.performMenuCommand({
    commandID: 31
  });

```

Besides, this link mention ▸ **close** ( `saveDialogOptions?` : SaveDialogOptions): _Promise‹void›_

[https://www.adobe.io/photoshop/uxp/ps\_reference/classes/document/](https://www.adobe.io/photoshop/uxp/ps_reference/classes/document/)

I couldn’t find any directions in how to use `saveDialogOptions`
