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)?

Community
  • 1
  • 1
Thomas Schultz
  • 2,446
  • 3
  • 25
  • 36

2 Answers2

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

paulmelnikow
  • 16,895
  • 8
  • 63
  • 114
valexa
  • 4,462
  • 32
  • 48
  • 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 01 '12 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 09 '12 at 00:26
-1

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

  • 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 01 '12 at 10:43