Tuesday, 14 April 2015

Apple: Configure Startup Application in Mac OS X

There are two method to configure the startup application in Mac OS X:
Method 1:
Add the application to the user's "Login Items" (under System Preferences=>Accounts=[user])

Method 2:
Add a launchd agent to the user's ~/Library/LaunchAgents folder

You may create a new launch agent file as follows:

~/Library/LaunchAgents/my.everydaytasks.plist

With contents:

<?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>Label</key>
    <string>my.everydaytasks</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Applications/EverydayTasks.app/Contents/MacOS/EverydayTasks</string>
    </array>
    <key>ProcessType</key>
    <string>Interactive</string>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <false/>
</dict>

</plist>

No comments:

Post a Comment