Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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}'

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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