• 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: How to determine whether launched automatically at login
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to determine whether launched automatically at login


  • Subject: Re: How to determine whether launched automatically at login
  • From: kai <email@hidden>
  • Date: Sun, 21 Aug 2005 11:34:10 +0100


On 21 Aug 2005, at 01:04, I wrote:

The following suggestion attempts to address some of these issues:

This modified version might help to improve the accuracy of the first run (and allow a little more flexibility when setting the value of the 'launchTime' property, should it be needed):


------------------

property prevLogin : missing value
property launchTime : 100 (* max seconds to launch app: adjust as necessary *)


on launchedAtLogin()
set currLogin to (info for POSIX file (POSIX path of (path to preferences ¬
from local domain) & "com.apple.loginwindow.plist"))'s creation date
tell prevLogin to if it is currLogin then
return false
else
set prevLogin to currLogin
if it is missing value and ((my (current date)) - currLogin) > launchTime then return false
end if
set loginData to read POSIX file (POSIX path of (path to preferences) & "loginwindow.plist")
considering case
tell POSIX path of (path to me) to if it ends with "/" then
text 2 thru -2 is in loginData
else
text 2 thru -1 is in loginData
end if
end considering
end launchedAtLogin


if launchedAtLogin() then
    display dialog "Launched at login."
else
    display dialog "Launched manually."
end if

------------------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How to determine whether launched automatically at login (From: Laine Lee <email@hidden>)
 >Re: How to determine whether launched automatically at login (From: Jeff Porten <email@hidden>)
 >Re: How to determine whether launched automatically at login (From: kai <email@hidden>)

  • Prev by Date: Re: Assigning blame
  • Next by Date: Re: [OT] Why don't I read anything about what is happening?... (Applescript-users Digest, Vol 2, Issue 547)
  • Previous by thread: Re: How to determine whether launched automatically at login
  • Next by thread: Re: How to determine whether launched automatically at login
  • Index(es):
    • Date
    • Thread