Re: Login item not hidden
Re: Login item not hidden
- Subject: Re: Login item not hidden
- From: Leonardo <email@hidden>
- Date: Wed, 08 Jun 2011 19:55:42 +0200
- Thread-topic: Login item not hidden
Thanks Jens but I can't split the engine from the interface. It's a huge
work. Also, the app should still work as a normal app, so I would not create
two projects, one for the app and one for the separate binary.
Any other idea?
I thought to create a small app e.g. FireApp and, as iTunesHelper, embed it
within my app. Then I add FireApp to the Login Items and make it fire the
timers. At any time fired, FireApp launches my app as hidden, e.g. with
LSUIElement. My app executes the task then quit and reset itself as "not
hidden".
So my question is now, can FireApp launch my app with LSUIElement on?
I mean, without setting LSUIElement to my app persistently?
I would not that any crash or problem left the flag LSUIElement forever on.
Or, I can create two equal apps, one with the LSUIElement = YES and one with
LSUIElement = NO. Then App1 should be used to run normally. App2 should be
used as login item. Could it work?
Regards
-- Leonardo
> Da: Jens Alfke <email@hidden>
> Data: Wed, 8 Jun 2011 10:31:53 -0700
> A: Leonardo <email@hidden>
> Cc: Cocoa Developers <email@hidden>
> Oggetto: Re: Login item not hidden
>
>
> On Jun 8, 2011, at 10:11 AM, Leonardo wrote:
>
>> - launch my app as hidden at a given time (I have a list of timers)
>> - do a task
>> - quit
>
> I suggest using launchd to schedule tasks to run at specific times. (Similar
> functionality to cron¹ on traditional Unix.) Then your app doesn¹t have to be
> running at all. You¹ll need to build a separate binary, for launchd to invoke,
> that runs without a UI; this can be built like a regular command-line tool, so
> you invoke your code from the main() function, don¹t link against AppKit, etc.
>
> To schedule the tasks, in a nutshell, you create a plist file for
> configuration, copy it into ~/Library/LaunchAgents/, and use NSTask to invoke
> launchctl¹ to register the plist.
>
> For more info see:
> man 1 launchctl
> man 5 launchd.plist
> and there¹s a long technote by Apple on daemons and agents.
>
> Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden