Stop Save dialog from appearing when quitting

When quitting Script Debugger the Save Dialog box appears asking if you want to save the file.

Is it possible to disable this dialog from appearing? Thanks

It’s not possible to suppress this dialog. If a script contains edits or changes that may need to be saved, this alert appears as is the practice of every document based application. If the document does not contain changes, but it is running, the alert appears in case you didn’t intend to abort your script’s execution.

1 Like

There are some apps, like BBEdit or Pages, that allow you to quit, and do not show save dialogs, but when you reopen the app, it returns to the state when you issued the quit. So all windows open, with their contents, even those that have never been saved. That may be what Zach99 is asking for.

Also, somewhat related, I’m noticing that if you have a new uncompilable script open and you close the window (or quit SD) the save dialog appears and does not give you an option to close without saving (or delete, as some dialogs put it). So, instead, you need to cancel the save, edit and compile the script (or just delete all its text) and then try to close again.

Plus, in some cases, I’m getting the “Save” dialog appearing more than once when closing a script.

This typically bites me when I’m trying to restart the Mac due to an update or a problem with the system, so I’m already dealing with cognitive overload. I dislike this intensely. Can’t overstate that. Even if you won’t allow for recovering unsaved files — Microsoft is doing this in Windows 11 with Notepad, of all things — a “Close without saving” button would be highly appreciated, even if you have to follow it up with an “Are you sure?” dialog.

I usually have at least one test script open that may be in an abandoned, uncompilable state from several days ago. I could care less about it now, and when the system is telling me it can’t restart and I’m getting a dialog from SD that I can’t override, it’s all I can do to keep my head and not do a hard shutdown in a panic. Please consider changing this behavior.

Turning this over some more in my head, here’s my argument for modifying the workflow when closing a script or quitting SD. (I should be in bed, but my brain won’t let this go.)

The issue is that SD is trying to compile the script before I’ve had a chance to tell it what to do.

I understand that .scpt is a compiled format by definition, so you can’t save the file until it compiles. It’s something nearly any other app wouldn’t have to deal with. But SD could be smarter about it, just by changing the order of things.

I want to see this dialog first:

If I click Save, that’s when you try to compile and give me the “AppleScript Compile Error” dialog if it fails. I’ve already decided that I want to save it — though I might change my mind now that I’m getting this error — so it’s up to me to decide what to do next: save it as text, fix the syntax so it’ll compile, comment out the code, or delete the entire contents of the script and try to close the file again.

Whereas if I choose Delete — which is likely if I was just using it as a scratchpad — then compilation isn’t even an issue.

So instead of

  1. Compile
  2. Ask to save
  3. Save

it should be

  1. Ask to save
  2. Compile
  3. Save

with the compilation error coming after the “ask” step, and only if I chose to save. This is distinct from the normal flow of saving a script, just by virtue of SD having to ask me if I want to save it. You could even reserve this for unsaved scripts if it doesn’t make sense for previously saved ones.

1 Like