Re: starting iCal and Address Book iconified, with py-appscript
Re: starting iCal and Address Book iconified, with py-appscript
- Subject: Re: starting iCal and Address Book iconified, with py-appscript
- From: has <email@hidden>
- Date: Mon, 25 Jan 2010 22:06:23 +0000
Bill Janssen wrote:
> I've been trying to quietly start up Address Book and iCal from a
> background process, on Leopard, using py-appscript. The code I'm using
> is this:
>
> app = appscript.app("Address Book")
> if not app.isrunning:
> app.launch()
>
> which I thought would open them quietly ("launch" instead of "activate").
isrunning is a method, not a property, so needs parentheses after it. As it stands, your conditional expression will always return False. [1]
Also, a more robust approach would be to use the new 'hide' argument, like this:
app = appscript.app("iCal", hide=True)
> But they both open on the desktop, in front, obscuring whatever else the
> user is doing. Is there any way to fix this? I'd like to have them
> start without opening a window, or if that's impossible, open iconified
> in the Dock.
Since AppleScript doesn't have any more luck launching Address Book without its window appearing, I'm guessing that one's a problem with AB itself. iCal should behave as long as you use the 'hide' option though.
HTH
has
[1] Minor typo in the py-appscript manual too; now fixed in svn.
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden