Re: Events by starting an application (better explained)
Re: Events by starting an application (better explained)
- Subject: Re: Events by starting an application (better explained)
- From: Patrick Machielse <email@hidden>
- Date: Thu, 15 Jul 2004 10:17:07 +0200
op 14-07-2004 08:47 schreef mirco scanarini
>
I have an application that starts when I login and
>
that of course can be started by double clicking on
>
the icon or on the alias icon.
>
I need to recognize the two different startup-ways in
>
the (just started) application.
>
>
Does it exist some System file where to find data
>
about the last actions it performed, like launching an
>
application and why it did it?
I don't know if this information is stored.
One idea would be to make your login item point to a small 'loader' that
launches your application with a command line argument. So for instance make
the login item an applescript:
do shell script "path/to/my/application -login"
This is probably only feasable if you set the login item programmatically.
(a more intelligent script could possibly find your app on it's own)
>
Alternatively the time difference between the login
>
and the start time of the application should be good
>
to solve the problem since login items starts
>
immediately after login.
You can find info on the last login in /var/log/lastlog. Do a 'man utmp' to
find out more about this file. (I must say I have never needed this myself)
Another thing you might do is check for processes that run only during
startup. On the other hand, they might have exited by the time your app is
up and running...
Patrick
---
Hieper Software
w: www.hieper.nl
e: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.