- In System Preferences uncheck `General > Close windows when quitting an app
- Open TextEdit.app
- Press Cmd+N for a New file
- Quit TextEdit.app
- In Finder go to
~/Library/Containers/com.apple.TextEdit/Data/Library/Saved Application State/com.apple.TextEdit.savedState/
we'll be looking for a file here shortly - Open TextEdit.app
- Quickly, open the file
restorecount.plist
that has appeared in Finder - Look at the
end
value
Currently, on my macOS installation, end
has a value of 570214618 which, as I understand it, means that since whatever epoch — a long time ago in an operating system far, far away — there have been over 570 million "windows" opened on my Mac. The value is shared across all user accounts. 10 months ago, that number was 544 million on my system according to this old question of mine: https://apple.stackexchange.com/a/320967/15281
The effect of this is that, for some apps, there is a noticeable (4 to 5 seconds) delay whilst they do something before their restored windows appear. My workaround, see the above linked question, is to turn off window saving for those specific apps. But I'd rather not have to do that.
So, I'd like to reset the restorecount
value at its source. Does anybody know where it is stored and/or how can I reset it?