I want to launch myapp.app during login time and it should work for all users.
I tried with osascript which launch only for a user who run that command .
/usr/bin/osascript -e "tell application \"System Events\" to make a new login item with properties {path : "Path/myapp.app" hidden:false name:"myapp"} at end "
I ran this log-in as a guser .So it launches during login of only guser .
And even i tried with sudo defaults write /Library/Preferences/loginwindow AutoLaunchedApplicationDirectory -array-add '{ "Path" ="path1" ; "Hide"="0";}'
When path1=myapp.app it didnt worked When path1=myapp.app/Contents/MacOS/myapp it is launching for all users but even a terminal window is launching along with the application .
I have a shell script from that i have to some command that launches cocoa app for all users login time. Please help .
sudo defaults write
doesn't work, see stackoverflow.com/questions/9483959/osx-10-8-loginitems – paulmelnikow