Hello all,
I am in need of some creative thinking. I’m not entirely sure whether what I’m wanting to do will be possible in Keyboard Maestro, but reasoned that if it is possible, then surely someone here that will be able to help me.
I recently purchased a UPS battery system, to keep my Mac Mini and 4-Bay usb RAID enclosure up and running in an outage – or to shut off safely, if needs be.
My challenge? The wifi router will only be connected at a much later stage, which means that I could be sitting at work, with the power off at home, and not be aware of it. This is obviously not ideal, since you don’t want to run down the UPS battery - preferably getting the Mini and Enclosure to shut down safely, rather than continue drawing power.
To further complicate matters, the UPS software unfortunately doesn’t play along nicely with my Mac. This means that I have no easy way to use the software to commence the shutdown procedure. I don’t have Parallels installed on the Mini (like I do on my MBP) - but were everything to be Windows, the software could initiate a shutdown after “x” amount of time. Or even ‘write’ to Notepad, which could then be used (through Coherence mode, possibly, with Parallels) to initiate a Hazel action or something.
So - the ‘usual’ software route, does not appear to be much of an option.
This had me look at KM.
The one that piqued my interest, was the [This Wireless Network] is [Disconnected] action.
Now my Wifi occasionally drops. But if it remains off for more than several minutes - chances are that its off, because there’s been a power outage.
So I’m thinking of the following:
1.) Have KM monitor the Network.
2.) If it disconnects, open Textedit.
3.) Create a new document.
4.) [Save As] “Wifi has disconnected”.
5.) Save it in “Wifi Disconnect” [folder] - that is being watched by Hazel.
6.) Repeat the process above, every 2 minutes(?)
7.) Continue to save similar files to that [Folder].
8.) Once Hazel sees 5 of the “Wifi disconnected” files in that Folder, invoke a Trigger
Not sure what the [Trigger] will be yet - still deciding on that (haven’t looked at Hazel in a while, tbh!)
9.) When [Trigger] “is created” - have KM invoke the shutdown procedure…
I am no doubt complicating things, due to my (very limited) understanding of both KM and Hazel’s features.
I’m thinking there is most like a shortcut to the above, that I am not thinking about?!
Of [Facepalm] proportions.
Would appreciate some ideas!