2

I found this Add app to OSX "Login Items" during a Package Maker installer postflight script but it doesn't appear to work in OSX 10.8?

This is from the other question and works in everything else...

defaults write \
    /Library/Preferences/loginwindow \
    AutoLaunchedApplicationDictionary \
    -array-add '{ "Path" = "/path/to/script"; "Hide" = "0"; }'

How can I add my app to loginItems in OSX Mountain Lion (10.8)?

0

2 Answers 2

1

OS X 10.8 is under NDA, we are not at liberty of giving details about it but i can tell you that there is no /Library/Preferences/loginwindow under 10.7 or any other recent OSX version, you should be doing :

defaults write \
    ~/Library/Preferences/loginwindow \
    AutoLaunchedApplicationDictionary \
    -array-add '{ "Path" = "/path/to/script"; "Hide" = "0"; }'

Notice the "~" tilde was missing

2
  • 1
    Note that this only adds it to the current user's login items, not the global login items. Adding to those only seems to be possible via the Launch Services' Shared File List API now.
    – pmdj
    Oct 1, 2012 at 10:40
  • Since this isn't an answer, but an admonition about NDA, it should be a comment. Consider updating this with a real answer now that 10.8 has been out for a while.
    – Bryson
    Dec 9, 2012 at 0:26
-1

OS X 10.8 stores login items in com.apple.loginwindow.plist

1
  • 1
    Citation? As far as I can tell, this is in fact false. Global login items are now stored in /Library/Preferences/com.apple.loginitems.plist - but you should not modify this file directly. Instead, use the Launch Services' Shared File List API (in LSSharedFileList.h). (10.6 and up)
    – pmdj
    Oct 1, 2012 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.