Don't Want to Have to Close Scrivener Frequently

I’d like to avoid getting the below error, but it’s very inconvenient to close Scrivener every night. My understanding is that this error results from leaving Scrivener running.

Writing is the main thing I do on my computer, so it’s convenient to have the app running as soon as I wake the computer from sleep.

Also, sometimes I get up from my computer not knowing whether I’ll be back in a minute or not until the next day. So, it’s inconvenient to shut Scrivener down in that situation.

My request: Please make it so that Scrivener works fine even if it isn’t closed periodically. Thanks.

*** SCRIVENER ERROR ***
NOTE: This error is harmless but we want to find the cause, so please read on.

Version: 3.1.3 (11945)

The following error occurred in Scrivener:
-setHasChanges: was called after the final save was performed. Observers should listen out for SCRMainDocumentWillPerformLastSaveBeforeCloseNotification for performing last-minute saves.

Please copy and paste everything in this message and email it to mac.support@literatureandlatte.com so that we can fix the bug. Please also provide information about what you were doing in Scrivener when this bug was triggered:

Have you set it up to make backups on manual save and remember to actually do manual save?

You don’t have to close Scrivener, only the project. Next morning you can easily open it with the shortcut on the opening window.

There’s a setting at – Scrivener Preferences > General > Automatic Quit > Automatically quit after a period of inactivity… Right below that is – Quit after inactive for: ? minute(s)

While this doesn’t address the bug (if that’s what it is), it’ll at least avoid it from being triggered when you’ve left the computer for an unknown/unplanned amount of time.

Aside from the -SetHasChanges crash – the origin of which we are (still!) trying to track down – closing Scrivener ensures that a number of important housekeeping tasks run, among them Scrivener’s automatic backup.

I guarantee that losing a project without a recent backup is more inconvenient than launching Scrivener when you wake up the computer! If you use Scrivener on multiple devices, shutting down the devices that you aren’t using also significantly reduces the risk of synchronization errors.

With all that said, there’s no reason why you can’t set Scrivener as a startup item, so that it launches whenever you boot the computer. There are also a variety of utilities that will launch a “workspace” with all the applications you use for a specific task. For example, I use Workspaces to simultaneously launch Scrivener, open the manual in Preview, and bring up the user forum and the internal support queue.

Katherine

Yes, I’m very good about manual saves. Ctl-B backs up to the cloud and to a thumb drive. My Mac’s Time Machine with its generous external drive gives me many backups going back ages.

Backing up shouldn’t depend on closing projects. There are other ways (nag dialogs, automatic backups while running).

This isn’t a big problem, but please think about this for the future. Lots of people like to leave their apps running—it shouldn’t cause bugs or data loss.

You can set the backup options in the Scrivener -> Preferences -> Backups pane.

Katherine

I repeat: You can leave Scrivener running without problem, as long as you close the project.

You are confusing things. Keep them apart.

Close the project (command-w) but leave Scrivener running. When you wake up your Mac, open recent…

I don’t fully agree with the running theme that one should necessarily close their project frequently—I don’t do that myself, though I have tuned my backup settings and practices to accommdate that way of working. I think there is a difference between recommending good practices to those that don’t dig into settings (close every night; you get backed up, even if you don’t really know what those words mean), and categorically stating that it is unsafe to use Scrivener in a fashion it was fully designed, optimised and honed over the years to be good at doing (that is, leaving it open forever).

  • For one thing I use the Back up with each manual save setting. With that, ⌘S becomes a meaningful command in Scrivener once again. I press that about two or three times per day, depending upon how much work is being done in the project.
  • While auto-save does make saving largely obsolete—there are a few things manual saving does, and they do entail the routine things Katherine referred to. These are things like writing out interface settings, Quick Look preview and so forth. Auto-save skips over that non-essential stuff to keep itself low profile, and so if you do depend entirely upon auto-save and then crash, you’ll see a little reversion in settings and such.
  • At the end of every day, all open projects can be backed up in a blanket fashion by holding down the Option key on the File menu, and selecting File ▸ Back Up ▸ Back Up All Projects Now. I do that when I’m done for the day, so I don’t care if it takes fifteen minutes to spool through everything I have open. I could probably set up a macro to do that for me, based on a screensaver trigger that happens after a certain hour—but I tend to remember.

That is one ingredient, yes, but the main problem is when opening and closing projects during the day, best we can tell. If you scroll down to the very bottom of those problem reports, you’ll find a readout showing which project caused the error—and chances are that project won’t even be open!

The bug itself, and likely why it is so difficult to pin down and fix, seems to be an issue with the garbage collection routines in the Mac. Some fragment of that project was left open in memory, even though it is fully shut down and closed on the disk. Our best guess is that when the Mac itself runs nightly maintenance it detects these orphaned pointers (or whatever) and forcibly shuts them down—which is by nature reported as an error.

So with all of the previous explained, this bug is quite benign, in all liklihood it is even synonymous with File ▸ Close in its effect (or rather, the tail end of Close finally happening). You can choose to Continue so as to give yourself the opportunity to gracefully close any projects that are open, and then restart the software. I would recommend doing that, because even though it is benign, who knows what secondary issues it may cause down the line.

I see it happen maybe twice a week or so. I open and close a lot of projects—most of them exist only to test one or two things and are then abandoned forever. So while my preference would be to leave projects open forever, they do tend to be opened and closed more often as a result. However I don’t preemptively shut down every night just on the off-chance the bug might be there in the morning. If it happens, it happens and I restart—oh well. If not, I forget it even exists.

It is annoying when it happens, but since it’s a difficult bug to figure out, I’ve just learned to live with it—and it’s nothing to be afraid of. Hence, you don’t have to close every night unless you want to. And if you prepare for that way of working, I would say it is no more risky—if anything I probably back up more often than I would if I just relied on nightlies without thinking about it. Like I say I treat backups like others treat saving (and I keep 25 to compensate for that).

Given how this bug happens, I don’t think that would actually help with it at all. :slight_smile: But even so, it isn’t exactly a solution to those that want to keep Scrivener running in a proper and useful sense: with the projects open. There is little point in just having the menu bar floating there all night by itself.

If convenience is the primary goal, but you decide shutting down Scrivener completely is also something you should/want to do, then I would (and I do) just quit Scrivener (CMD-q) with my project(s) open. I have it set to re-open those projects on launching Scrivener.

No matter how you start Scrivener (click on it in the dock, CMD+space + typing “Scriv” + enter), that’s a quick way to get back to where you were, usually.

I just started to encounter this error a lot – and even if I keep the app running, but close the project (so what was stated above about closing project for the night to prevent this is not true!).

I even sent few of the error logs to the support, but haven’t heard back yet…

I corrected that misconception in my last post here. It is actually closing projects that is the source of the error. If you are closing all of your projects but leaving Scrivener open it may happen—but there is little reason to leave it open at that point.

I suggest reviewing my post, it has all of the information we know about the problem and how it isn’t something to worry too much about.

The error occurs whether I close the project or not.

Sometimes it happens, when I stop writing for a while and just switch to my browser to do something else (like update my Nanowrimo wordcount these days).

Sometimes I hit the close button when I’m done for the day, not realizing it will close the project and not just hide the window away.

And as to why keep the app running with closed project – well, since I’m putting my Mac to sleep late at night and resume my work again in the morning, I just usually keep it open all the time. Sometimes, as stated above, I hit the close button by mistake, but don’t really feel like quitting the app via dock icon. I just close my Mac and that’s it.

I’m not worried about losing any work, after it popped up at least ten times in the last week.

It’s just annoying to start/open Scrivener and have all these text files pop up around my desktop (and sometimes even the send-error-log screen after that).

And usually it resets my session wordcount, if it crashes randomly in the middle of the day.

That would be an interesting result in that case, I’ve never seen it happen to a project that is open, and that has never been closed since the software was launched. To double-check that this is the case, as I suggested above: scroll to the bottom of the text file that is opened, and confirm the project in question is the culprit. If there is nothing listed at the bottom of the file indicating a project, it’s a different type of report you are looking at.

It may be you’re seeing more than one problem as well. In my experience this specific issue tends not to cause crashing—though in theory it could—and it shouldn’t be during or throughout the day. It appears particularly at local midnight, when the Mac runs a series of daily background maintenance tasks presumably. Of course if you sleep the Mac before midnight then it will happen at any point in the day when the system first brings Scrivener to the front, but it then should not happen for the rest of that day until midnight passes again.

Oh, forgot to address sending error logs to support: those are not sent to support as they aren’t terribly useful outside of spotting large-scale patterns.

Okay, well if you don’t mind a keyboard shortcut or two now and then, ⌘Q is a really handy one to learn. It fully shuts down the application you are using, closing all of its active windows at once.