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?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Andreas
  • 1,061
  • 1
  • 11
  • 26

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
  • 4,331
  • 2
  • 18
  • 14