7

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?

7

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.)

2

It looks like Apple has removed the built-in functionality from Calendar. However, there are 3rd party applications that can launch apps automatically at a specified time.

Try Lingon -it works in Mavericks...

  • 1
    I hate having to buy an app to accomplish something that used to be free and built into an app as basic as Calendar, but Lingon looks like it's what I want. In fact, your answer led me to some excellent info on launchd, which just reinforces why Lingon is probably the way to go. Thank you! – 2oh1 Nov 20 '13 at 7:37
  • Sure. However - Lingon is simply a GUI that allows for easy editing of launchd scripts. If you're willing, you can create the .plist files directly. However, for a few dollars, Lingon does make creation & editing of the .plist files much easier. And, nice reference you've linked to re: launchd. – Scot Nov 20 '13 at 7:42
2

The option to open a URL in iCal was actually removed in Mountain Lion, but you can now use Calendar alarms instead:

Using launchd, you could save a plist like this as for example ~/Library/LaunchAgents/openmail.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>openmail</string>
  <key>ProgramArguments</key>
  <array>
    <string>bash</string>
    <string>-c</string>
    <string>pgrep -x Mail||open -jga Mail</string>
  </array>
  <key>StartCalendarInterval</key>
  <dict>
    <key>Hour</key>
    <integer>3</integer>
    <key>Minute</key>
    <integer>55</integer>
  </dict>
</array>
</plist>

Then run launchctl load ~/Library/LaunchAgents/openmail.plist.

A third option is to run EDITOR=nano crontab -e and add a line like this:

55 3 * * * pgrep -x Mail||open -jga Mail

open -jga opens an application hidden and usually without raising any windows. For some applications like Mail and TextEdit, it creates and raises a new default window if the application is running but has no visible windows, but you can use pgrep to check if the application is running first.

If you want to open the application on the foreground, use just open -a.

0

I had the exact same problem and found an app on the app store that provides a graphical user interface for Launchd, it's called Plisterine.

My use-case was to lunch Outlook for Mac on a specific time, keep it open for one hour and then close it again. For this, I created an Automator application/workflow as shown in the screenshot below:

The Automator workflow

You can just ignore the message "Application receives files and folders as input" as it is not needed for this workflow.

I then just added a new entry on Launchd by using Plisterine so that the Automator workflow gets triggered on schedule, see screenshot below:

Adding an entry on Launchd in Plisterine

It works like a charm and is easy to setup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .