Any recommendations on automatically un-mounting external hard drives when my macbook pro is getting low on battery? There have been a couple of times when I forgot to plug in my MBP and had USB devices plugged in. When I get back to the my MBP, it says the drives were not disconnected properly. Are there any diagnostic tests I can run to make sure the drives are ok? Thanks in advance
MBP Late 2014
MacOS Mojave 10.14.6
External Hard drives - Seagate Backup + 8 TB
With the apps I have I’d create a KeyboardMaestro macro to look for a lowbattery property and activate some clicks on one of the many free or cheap disk eject/jettison menubar apps (I use Mountain). If you have KeyboardMaestro you might get some ideas on how to do this from these two links (or you might ask in the KeyboardMaestro discourse forum)
It’s an app designed to run certain actions (including scripts, AppleScripts, etc) when certain power “events” happen. For example, when my battery power gets to 30%, I get a persistent on-screen notification. At 20% the computer ejects drives and sleeps. At 10% it shuts down.
@bowline is correct that you can do this with Keyboard Maestro and/or launchd, but Power Manager is a great tool for stuff like this, in the same way that Hazel is better than Folder Actions.
The app used to be pretty expensive, but it’s now a $12/year subscription, I think, with a 30-day trial. Well worth checking it out.
I use a script like this (and a related one) to mount and unmount my normal every-day volumes. I don’t have mine trigger automatically, I just launch them through LaunchBar. @r2d2 could then take that script and have it called by one of these other apps, like Keyboard Maestro. If the low power attribute wrote something to a file somewhere, you might be able to create a Hazel rule for it.