• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: delete the entry from loginwindow.plist using command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delete the entry from loginwindow.plist using command


  • Subject: Re: delete the entry from loginwindow.plist using command
  • From: Mike Fischer <email@hidden>
  • Date: Tue, 29 Jan 2008 22:01:52 +0100

Am 29.01.2008 um 21:07 schrieb "sunil prajapati" <email@hidden>:

Hi Guys,

I successfully entered my application in loginwindow.plist through command
line. But unable to delete that entry.

Does this have anything to do with the topic of this mailing list?


How to remove the my added entry from loginwindow.plist from command line
or shells script?

First of all the loginwindow.plist is an implementation detail managed by the system. You should not access it directly. You should most definitely not modify this file!



From net I found one script which remove the entry from
loginwindow.plist,but
it remove whole entries from the plist.

The command is:

#!/bin/sh
theApp="your app"
nl=`echo "x" | tr 'x' '\34'` # what is the proper way to set ascii to a
variable?
aaa=`defaults read loginwindow AutoLaunchedApplicationDictionary`
bbb=`echo -n "$aaa" | sed "s/^[()]$//;s/},/}$nl/" | tr '\n\34' '\00 \n'| grep
-va "$theApp" | tr '\n\00' ',\n' | sed 's/^,$//'`
defaults write loginwindow AutoLaunchedApplicationDictionary "($bbb)"


Waiting for helpful reply.

This is just one of the problems you encounter when accessing this file directly. From your question it seems that you want to add and remove Login Items, correct? As you probably noticed there are no official APIs for this.


Depending on your needs you might consider either launchd(8) (LaunchAgents, 10.5+ only). Or if you really need a Login Item then you should use the Apple sanctioned method shown in the Sample Code project 'LoginItemsAE' (<http://developer.apple.com/samplecode/ LoginItemsAE/index.html>). It's not an API but it get's the job done in a way that is not totally broken and dangerous like your code above.

See: <http://developer.apple.com/technotes/tn2005/tn2083.html>


--
Thanks & Regards,

Sunil Prajapati
Software Developer in Macintosh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.apple.com/mailman/private/macnetworkprog/ attachments/20080129/ef606aa2/attachment.html

Anything other than plain-text e-mail without attachements doesn't make it through the mailing list in many cases. So please use plain test only.



HTH Mike -- Mike Fischer Softwareentwicklung, EDV-Beratung Schulung, Vertrieb Note: I read this list in digest mode! Send me a private copy for faster responses.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: delete the entry from loginwindow.plist using command
      • From: Quinn <email@hidden>
  • Prev by Date: Re: delete the entry from loginwindow.plist using command
  • Next by Date: Re: delete the entry from loginwindow.plist using command
  • Previous by thread: Re: delete the entry from loginwindow.plist using command
  • Next by thread: Re: delete the entry from loginwindow.plist using command
  • Index(es):
    • Date
    • Thread