[Pythonmac-SIG] using appscript to add a login item?

Ned Deily nad at acm.org
Thu Dec 4 02:26:06 CET 2008


In article <39627.1228352020 at parc.com>, Bill Janssen <janssen at parc.com> 
wrote:
> I'm trying to add a login item in an installer, and I thought using
> appscript would be the simplest way.
> 
> >>> from appscript import *
> >>> a = app("System Events")
> >>> a.login_items()
> 
> Sure enough, a display of items.  But how do I create a new one and add
> it?

a.login_items.end.make(new=k.login_item, 
    with_properties={k.path:"/Applications/TextEdit.app", k.hidden:True})

(Adapted and translated from the AppleScript here: 
<http://macstuff.beachdogs.org/blog/?p=30>)

-- 
 Ned Deily,
 nad at acm.org



More information about the Pythonmac-SIG mailing list