I've tried multiple ways but none work. A few AppleScripts and even some bash script somebody made. Which essentially just executes a different AppleScript afaik.

Some of the commands I have tried:

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

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

defaults write loginwindow AutoLaunchedApplicationDictionary -array-add '{ "Name" = "AppName" ; "Path" = "/Applications/AppName.app"; "Hide" = 0; }'

defaults write loginwindow AutoLaunchedApplicationDictionary -array-add '<dict><key>Hide</key><false/><key>Path</key><string>/path/to/item</string></dict>'
  • Posting a few samples of the AppleScript and bash script code which doesn't work can help determine what may be wrong.
    – IconDaemon
    Commented Nov 26, 2019 at 14:33
  • Done. Edited the post. Commented Nov 26, 2019 at 14:41

1 Answer 1


Try enabling AEServer and/or Script Editor in System Preferences > Security & Privacy > Accessibility. Occasionally I've had to quit and relaunch System Preferences for new login items added via AppleScript to appear.

After doing this I was able to add login items via AppleScript. Confusingly, after I disabled Accessibility access for AEServer and Script Editor I was still able to add login items via AppleScript.

  • I just tested this in macOS Catalina 10.15.4 and it does not work! Commented Apr 12, 2020 at 4:48
  • Sorry to hear that 😕 I'm also on 10.15.4 and it worked for me. Did you try restarting System Preferences? Also, from which app are you running the script?
    – ACB
    Commented Apr 12, 2020 at 5:31
  • Yes I restarted System Preferences. Tried in both Script Editor and Terminal, both have permission as well as AEServer. Commented Apr 12, 2020 at 5:35
  • A wild stab in the dark: Did you grant them permission in an earlier version of MacOS? If so, try disabling and re-enabling. Other than that, I would restart your computer and hope for the best. Sorry I can't be more helpful.
    – ACB
    Commented Apr 12, 2020 at 6:30
  • This is on a clean built system running macOS Catalina 10.15.4 and also has been rebooted before and after adding AEServer and it didn't work. Commented Apr 12, 2020 at 6:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .