Long time podcast listener, first time poster.
Over the years, I’ve learned just enough AppleScript and terminal commands to get my Mac to do what I want. But I always had a problem getting my Mac to do what I wanted when I wanted.
I used to use Automator to create calendar alarms, but they were temperamental and unreliable. I’m sure I injured a few scalp follicles due to pulling my hair in frustration.
I tried out the apps PowerManager and Keyboard Maestro. I was able to use them to create and schedule macros, and they certainly are wonderful apps. But then, I got caught—by the DIY bug! I decided to see if I could use the Mac’s built-in capabilities to achieve what I wanted. When I learned about Launch Agents, I felt like Hermione Granger discovering a powerful spell book.
Launch Agents often get mentioned in the context of looking for agents installed by third party, or even malicious, software, in order to remove them. However, they are simply a way that MacOS allows talking to launchd, the powerful daemon that starts the system at bootup and loads and runs services. I decided to create my own Launch Agents. It turned out to be very doable for a mere mortal. I now have written 10 launch agents to run various AppleScripts on my Mac at the times I find most useful. You can also schedule shell scripts or Automator workflows if those are your things.
Why bother? First, to go beyond the limits of the Mac GUI; second, for the fun of it! I have agents that:
- sleep my Mac at different times on different days
- orchestrate which AirPlay speakers should play what, when, and how loud
- mount and run my Time Machine backup on my chosen schedule
- export archives of my calendars and contacts weekly
- randomize my screensaver daily
…and more. I finally feel like my powers of automation on the Mac have caught up to what I can do with Shortcuts on iOS. Now I feel like Hermione having just mastered the big spell book!
There are plenty of articles on the interwebs. I found these helpful: