2

This application shows in Finder at path (with target):

Macintosh HD/Applications/Trans_Helper.app/Contents/MacOS/applet

and I have not been able to successfully start it with launchd, using

~/Applications/Trans_Helper.app/Contents/MacOS/applet
//  or
/Users/myusername/Applications/Trans_Helper.app/Contents/MacOS/applet

Repeatedly seeing the following in console:

… com.apple.launchd.peruser.501[150] (com.mahogany.sarah[1156]): Job failed to exec(3). Setting up event to tell us when to try again: 2: No such file or directory
… com.apple.launchd.peruser.501[150] (com.mahogany.sarah[1156]): Job failed to exec(3) for weird reason: 2
… com.apple.launchd.peruser.501[150] (com.mahogany.sarah): Job should be able to exec(3) now.

So, I am concluding that the file is not referenced correctly.

In case it helps, the plist file in ~/Library/LaunchAgents looks like:

<dict>
    <key>Label</key>
    <string>com.mahogany.sarah</string>
    <key>ProgramArguments</key>
    <array>
        <string>~/Applications/Trans_Helper.app/Contents/MacOS/applet</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>15</integer>
        <key>Minute</key>
        <integer>25</integer>
    </dict>
</dict>

EDIT: It finally worked using suggested changes AND removing the tilde from before /Applications. (This is, incidentally, exactly what the Finder > File Info displays for the applet)

<dict>
    <key>Label</key>
    <string>com.mahogany.sarah</string>
    <key>Program</key>    // Change here and removing 1st char of string on next line
    <string>/Applications/Trans_Helper.app/Contents/MacOS/applet</string>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>15</integer>
        <key>Minute</key>
        <integer>25</integer>
    </dict>
</dict>
0

There's two problems with the above plist.

  1. You've put the program in the ProgramArguments key.

    Replace the ProgramArguments key with the Program key and the array with a string.

  2. You can't use ~ in a Launch Agent plist.

    Replace the ~ with the absolute path.

  • You're saying there should only be a Program key? – David C Jul 26 '14 at 20:13
  • @David If you're not passing arguments, yes – grg Jul 26 '14 at 20:13
  • Is Program key with a string value? – David C Jul 26 '14 at 20:15
  • @David Yes, no array, just one string – grg Jul 26 '14 at 20:17
  • Having Program as array results in Invalid argument upon launchclt load … The plist will load with Program key and string value. – David C Jul 26 '14 at 20:21

You must log in to answer this question.

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