Launching an app n minutes after boot up

Not directly, but you can do much the same thing by starting a script that will wait ten minutes, then launch the application. For example, with an AppleScript:

delay 600 --600 seconds == ten minutes

tell application "Dropbox" to activate
tell application "Something Else" to activate

Open AppleScript Editor in /Applications/Utilities and type this in. Then, save it as an Application, and add that Application to your log in items.

This will start the application(s) ten minutes after you log in rather than after when you start up, but your question suggests that you're automatically logging in on start up anyway. Starting Mac GUI applications genuinely on startup tends to not work.

[edit]Per Daniel Beck's suggestion, here's a way to do this silently:

Create the AppleScript described above, but save it as a script. Then create a Launchd property list. If you've installed the Mac OS X dev tools, you can use the Property List Editor that's included with them, or you can use a text editor (as it's XML). Create the following:

<?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>some.meaningful.name</string>

    <key>OnDemand</key>
    <false/>

    <key>ProgramArguments</key>
    <array>
        <string>osascript</string>
        <string>/path/to/your/applescript.scpt</string>
    </array>

    <key>KeepAlive</key>
    <false/>
</dict>
</plist>

Save this in ~/Library/LaunchDaemons/some.meaningful.name.plist. Then when you log in, your AppleScript will be run, though it will not provide an icon on the dock, which would allow you to cancel.


Scott's answer unfortunately doesn't work on the newer versions of OS X. The version below has worked for me on Yosemite.

Firstly, remove the app from Login Items (System Preferences -> Users & Groups). But even if you do that, some apps (e.g. Dropbox), will add itself to Login Items again. So you also have to disable autostart in your app.

Then, as Scott has written, create an AppleScript script like this:

delay 600 --600 seconds == 10 minutes

tell application "Dropbox" to activate
tell application "Something Else" to activate

Now you have to create a Launch Agent – just a file with the extension plist – in ~/Library/LaunchAgents/. The name could be for example com.yourname.delayed.start. (Don't forget to append the .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>name</string>

    <key>ProgramArguments</key>
    <array>
        <string>osascript</string>
        <string>/path/to/your/applescript.scpt</string>
    </array>

    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

name (the value of Label) should be the same as filename (but without the extension – .plist)

And that's all, the next time you login, apps you have specified in your script should launch after 10 minutes.

Tags:

Boot

Mac