MacOS – automatically launch an app at a specific time on Mavericks

applicationscalendaricalmacos

For years, I've been using iCal to automatically launch apps using alarms. I'd create a new event in iCal and set the alarm to launch an app rather than show a notification. The option to set alarms to launch apps or URLs (etc) seems to have been removed from Calendar in Mavericks, which means my automatic apps don't launch anymore.

How can I gain this functionality back in Mavericks. It doesn't have to be in Calendar (though, grrr, I wish that still worked! I loved having a calendar that showed all of my automatically launched apps and times at a glance!).

Example: There's an excellent Flickr app called SuprSetr which I'd like to automatically launch each morning at 3:55 am. How?

Best Answer

The great thing about a specific question is that it can be given a specific answer.

For example, the OP said: "There's an excellent Flickr app called SuprSetr which I'd like to automatically launch each morning at 3:55 am. How?"

Answer: Save the following as com.tjluoma.SuprSetr.plist (or whatever name you prefer, but it should end with .plist) and put it into the folder ~/Library/LaunchAgents (where ~ is your Home Directory):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>AbandonProcessGroup</key>
    <true/>
    <key>Disabled</key>
    <false/>
    <key>Label</key>
    <string>com.tjluoma.SuprSetr</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/open</string>
        <string>-a</string>
        <string>SuprSetr</string>
    </array>
    <key>StartCalendarInterval</key>
    <array>
        <dict>
            <key>Hour</key>
            <integer>3</integer>
            <key>Minute</key>
            <integer>55</integer>
        </dict>
    </array>
</dict>
</plist>

And then, once the file is in place, you should enter this command in Terminal:

launchctl load ~/Library/LaunchAgents/com.tjluoma.SuprSetr.plist

Then it will be ready to launch the app SuprSetr at 3:55 a.m. every day. (Note: if the computer is asleep at 3:55 a.m., it will run when the computer wakes up.)

From that specific example, once you understand that what this plist file does does is tell launchd to run the Terminal command:

/usr/bin/open -a SuprSetr

at the hour '3' and the minute '55', then it should be easy to extrapolate from that to other apps that you want to run at other times.

Now, if you want to write these all by hand, you can do that for free, but an app like Lingon is a good choice (I'd recommend not buying the Mac App Store version, as the app seems to me like something that Apple is not going to like in the world of sandboxing, and you'd get a more feature-rich app from the developer.

My personal preference is for an app called LaunchControl which is free to try, and then the developer asks for something reasonable like US$10, but there is no DRM, no license codes, but instead relies on the good ol' honor system. (It’s my hope that people who use it will live up to the developer's faith in that system.)