The Command to enter login items is not working in 10.8 I am entering the login item from the terminal but, this command is not working for me:

defaults write ~/Library/Preferences/loginwindow AutoLaunchedApplicationDictionary -array-add '{Path="/Applications/Your Application.app";}'


What am I doing wrong?
I didn't have AutoLaunchedApplicationDictionary in ~/Library/Preferences/loginwindow.plist but only in /Library/Preferences/loginwindow.plist.

Most login items are stored in ~/Library/Preferences/com.apple.loginitems.plist. The paths are stored as alias data, but you can also add login items with AppleScript:

osascript -e 'tell application "System Events" to make new login item at end with properties {path:"/Applications/TextEdit.app", name:"TextEdit", hidden:true}'