When I reboot, either manually or "accidentally", I have my Mac set to reopen all windows. I want to be back where I started. There are over a dozen apps that get restarted this way, Including the KBM Editor.
How can I tell when this process is complete, so that I can start something else? In particular, I want to clean up the various apps that don't restart exactly the way that I want them to. I want that cleanup to happen as soon after reboot as possible, otherwise I could just set a timer for 10 minutes.
It appears that there is a particular order in which everything gets restarted. Keyboard Maestro is somewhere in the middle. On reboot I can watch multiple apps, which had been in different Mission Control Desktop Workspaces (Spaces/Desktops) start up in Desktop 1. Then the KBM Editor starts, and it reopens in the same Desktop that it had been, Desktop 12 in my case. The apps that get restarted after KBM then open in that Desktop Space, instead of in Desktop 1. Again none of them actually belong in the KBM Desktop any more than they belong in Desktop 1.
The order in which the apps open, and whether or not they open before or after KBM, seems mostly consistent. But is that consistency because that's the order they were opened in at the last reboot? Or is there some other prioritization at work? Are apps able to tell the system whether they should be restarted early or late?
I thought of checking for all my usual apps, using something like
But not all my typical GUI apps will necessarily be open at shutdown and thus be restarted at reboot. And there are apps with no windows that I have little clue of where there are in the startup order. One GUI-less app that is usually always restarted is WhichSpace.Because WhichSpace has a Toolbar icon, I can see that it starts up relatively late in the process. Is there any way of finding it in a Startup list somewhere and seeing if there are any entries after it?
If there was some app that was always started last, which I could somehow know would always be the last app to be started on a reboot, then I could have my KBM cleanup macro wait until that app was active and then be able to run in confidence.
Is there any way to examine what the app restart order might be? Is there any way to manipulate the order? Is there any way for me to force an app to always start last, maybe an app of my own creation?
Alternately, is there some system API flag, possibly named something like NSSystemRestartHasCompleted
, that I could test?
Ideas welcome.