Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



MacOS X - How to ad...
 
Share:
Notifications
Clear all

[Solved] MacOS X - How to add, remove, view items to the Login Items from Terminal

2 Posts
1 Users
0 Reactions
1,434 Views
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2859
Topic starter  

Add an item:

osascript -e 'tell application "System Events" to make login item at end with properties {path:"/path/to/yourapp", hidden:false}' 

Remove an item:

osascript -e 'tell application "System Events" to delete login item "yourappname"' 

List all items:

osascript -e 'tell application "System Events" to get the name of every login item'

Enjoy!


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2859
Topic starter  

Note:

You can also use the following to add an app:

osascript -e 'tell application "System Events" to make login item at end with properties {name:"AppName",path:"/path/to/yourapp", hidden:false}' 

You can also call for the paths of all login items:

osascript -e 'tell application "System Events" to get the path of every login item'

   
ReplyQuote
Share: