Thanks for the bug report. We’ll look into it and see if we can sort this out for an upcoming maintenance release.
I suspect that when you restart your machine, macOS is causing Script Debugger to shutdown in a way we’ve not tested for and the app’s preferences are not properly being flushed to disk. As you’ll imagine, this is a difficult scenario to debug.
Just found out that a similar issue happens when SD crashes: it doesn’t remember open windows of saved documents after relaunching. Which, I guess, is part of the same issue.
(After a crash SD will remember unsaved documents, which probably is a built-in functionality… I’m not experienced in document-based apps).
I’m sure you don’t need my suggestions on how to solve it, but one possible primitive solution for existing files is to just write the path of a document to preferences once the user opens the doc in SD. This way it’s always stored in prefs no matter how the app is closed. (Once again, I’m sure there are better ways to achieve this.)
Yes, it is bizarre and frustrating from our perspective as well. When you quit an application in this way (Dock->Quit or System Shutdown) macOS applies an optimization where the application is terminated without allowing it to go through its full shutdown process in order to accelerate the operation.
Thank you to everyone for digging into this and figuring out when the happens. We’ll try an improve things in a future maintenance release.
I didn’t try a reboot yet - but the Dock’s Quit menu issue is NOT fixed.
Like I mentioned, the problem only occurs if there’s an unsaved document open among other documents. That is, SD will ask to save the document on quit. It doesn’t matter how you dismiss this dialog - Save or Don’t Save, but open documents still won’t be remembered after this.
You’ll have to describe the test case again for me then.
My tests with SD’s Quit command and the Dock - Quit command have SD remembering all documents open at the time the application quits. Unsaved documents are saved, and then re-opened when Script Debugger launches again.
-Type something inside the new doc (to make it unsaved)
-Right-click Script Debugger in the Dock > Quit menu
-Click “Don’t Save” in the “Do you want to save changes…” dialog
No documents will be open on my machine. (I don’t expect new unsaved docs to be open, obviously, only the previously existing ones.)
-Just like before, the issue only happens when using the Dock’s Quit menu.
-If you click “Save” in the “Do you want to save changes…” dialog, the issue doesn’t happen - all docs will be remembered on relaunch. That’s indeed a new fix (as previously clicking Save wouldn’t make a difference).