I had some problems saving and closing files

I had some problems saving and closing files.

When I close a file with the following code, a dialog box always pops up. How can I close the file without saving?


How to set the image quality when using the API provided by uxp for saving files?

app.activeDocument.save(EntryFile, {embedColorProfile: true });

Regarding the close document, you can use this descriptor in a batchPlay call:

export function closeDocument(save: boolean = false): ActionDescriptor {
  return { 
    _obj: 'close',
    saving: {
      _enum: 'yesNo',
      _value: save ? 'yes' : 'no',
    _options: {
      dialogOptions: 'dontDisplay',


photoshop.action.batchPlay([closeDocument()],{}) // close and don't save
photoshop.action.batchPlay([closeDocument(true)],{}) // close and save

Thank you very much. This is the code I use now