Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hatbe

macrumors newbie
Original poster
May 12, 2011
4
0
Hi,

I'd like to add and remove my own test scripts/apps in the "Login Items" from the "System preferences" / "User. Group" by using the terminal command line (not from the GUI).]

I am running Mac OSX Lion 10.7.1 and 10.7.2

For exp:

- add scripts from /Users/myuser/myscript1.sh to the "Login Items"
- remove script myscript2.sh from the "Login Items"
- and so on...

Does the defaults command or something else can do these actions, if so what is the syntax? I would appreciated any helps.

Thanks,
HB
 
Have a look at your User Library: /Preferences/com.apple.loginitems.plist

You'll see your login items there.

Objective C or Applescript are better suited to modifying plists than is Shell.

Either of those languages will provide a decent front end for parsing terminal's
Code:
defaults read com.apple.loginitems
and the corresponding write commands.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.