Skip to main content
updated to reflect OP's specific app
Source Link
TJ Luoma
  • 20.9k
  • 9
  • 72
  • 114

ThisYou should be able to just add “Opening 5.app” to the System Preferences » Login Items.

But if that doesn’t work for some reason, this sounds like the perfect job for a launchd .plist. They can be tricky to write, but there are two apps which are very good for getting the hang of them. The first is Lingon and the second is LaunchControl. They both have demos, and I would recommend trying them both and seeing which one you prefer.

If you can update your post with more specifics about the kind of script that you're trying to run, I can probably make a launchd plist for you that you can just “drop in” and use.

If you're keen to learn more about launchd, a good resource is http://www.launchd.info.

In fact, theHere's an example script on that homepage might giveof how you a starting point to usemight handle launching that app at login:

<?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>com.exampletjluoma.app<opening5</string>
    <key>ProgramArguments</key>
    <key>Program</key><array>
        <string>/Usersusr/Mebin/Scriptsopen</cleanup.sh<string>
        <string>-a</string>
        <key>RunAtLoad<<string>Opening 5</key>string>
    </array>
    <true<key>RunAtLoad</>key>
    <true/>
</dict>
</plist>

But, again, I’d be happySave that to provide more help if you can give some more info about~/Library/LaunchAgents/com.tjluoma.opening5.plist (where ~ refers to your specific needshome directory).

When you reboot (or logout and then login), it should launch “Opening 5” at login.

This sounds like the perfect job for a launchd .plist. They can be tricky to write, but there are two apps which are very good for getting the hang of them. The first is Lingon and the second is LaunchControl. They both have demos, and I would recommend trying them both and seeing which one you prefer.

If you can update your post with more specifics about the kind of script that you're trying to run, I can probably make a launchd plist for you that you can just “drop in” and use.

If you're keen to learn more about launchd, a good resource is http://www.launchd.info.

In fact, the example script on that homepage might give you a starting point to use:

<?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>com.example.app</string>
        <key>Program</key>
        <string>/Users/Me/Scripts/cleanup.sh</string>
        <key>RunAtLoad</key>
        <true/>
    </dict>
</plist>

But, again, I’d be happy to provide more help if you can give some more info about your specific needs.

You should be able to just add “Opening 5.app” to the System Preferences » Login Items.

But if that doesn’t work for some reason, this sounds like the perfect job for a launchd .plist. They can be tricky to write, but there are two apps which are very good for getting the hang of them. The first is Lingon and the second is LaunchControl. They both have demos, and I would recommend trying them both and seeing which one you prefer.

If you're keen to learn more about launchd, a good resource is http://www.launchd.info.

Here's an example of how you might handle launching that app at login:

<?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>com.tjluoma.opening5</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/open</string>
        <string>-a</string>
        <string>Opening 5</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

Save that to ~/Library/LaunchAgents/com.tjluoma.opening5.plist (where ~ refers to your home directory).

When you reboot (or logout and then login), it should launch “Opening 5” at login.

Source Link
TJ Luoma
  • 20.9k
  • 9
  • 72
  • 114

This sounds like the perfect job for a launchd .plist. They can be tricky to write, but there are two apps which are very good for getting the hang of them. The first is Lingon and the second is LaunchControl. They both have demos, and I would recommend trying them both and seeing which one you prefer.

If you can update your post with more specifics about the kind of script that you're trying to run, I can probably make a launchd plist for you that you can just “drop in” and use.

If you're keen to learn more about launchd, a good resource is http://www.launchd.info.

In fact, the example script on that homepage might give you a starting point to use:

<?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>com.example.app</string>
        <key>Program</key>
        <string>/Users/Me/Scripts/cleanup.sh</string>
        <key>RunAtLoad</key>
        <true/>
    </dict>
</plist>

But, again, I’d be happy to provide more help if you can give some more info about your specific needs.