0

I just got an assignment where I need to add the running program to the login items for all users on OSX >= 10.5. The program is a command line tool and I am developing it in xcode. I found some ways to add login items, but they either run from a shell or use the cocoa framework.

How can I do this?

Flimzy
  • 68,325
  • 15
  • 126
  • 165
Andreas
  • 1,050
  • 1
  • 10
  • 24

1 Answers1

0

Here's an example of how I've done this from the command line:

defaults write loginwindow AutoLaunchedApplicationDictionary -array-add '{Path="/Applications/Utilities/Terminal.app";}'

To execute a command like that from Obj-C, see this thread:

Cocoa/ Objective-C Shell Command Line Execution

Community
  • 1
  • 1
webjprgm
  • 3,911
  • 2
  • 16
  • 14