I was on a lookout for a certain trigger to automate macOS, a sleep trigger. I try not to automate any of the scripts around uncertain triggers, especially sleep cycles, when there may be certain expectations of how things should be at that moment. For example, if a script inadvertently disrupts the machine from going…