Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kaloprominat/6111584 to your computer and use it in GitHub Desktop.
Save kaloprominat/6111584 to your computer and use it in GitHub Desktop.
macos: manage add list remove login items apple script
# applescript
# add login item
osascript -e 'tell application "System Events" to make login item at end with properties {name: "Notes",path:"/Applications/Notes.app", hidden:false}'
# delete login item
osascript -e 'tell application "System Events" to delete login item "itemname"'
# list loginitems
osascript -e 'tell application "System Events" to get the name of every login item'
# with defaults
defaults write loginwindow AutoLaunchedApplicationDictionary -array-add '{ "Name" = "Notes" ; "Path" = "/Applications/Notes.app"; "Hide" = 0; }'
@Arduingo
Copy link

Arduingo commented Apr 11, 2025

All 3 Applescripts lines works in Sequoia, the example to add an app is not working but is because it cannot find Notes.app, if you replace it with Safari.app it works fine, the Notes.app is stored in /System/Applications. Read from the plist is not working for me in Sequoia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment