Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How many seconds since I logged in



On 7/6/05 5:34 AM, "Jasper Van Proeyen" <email@hidden> wrote:

> Or:
> set the_user to do shell script "whoami" -- even shorter ;-)

Exactly the same length as "id -un".

The "ac" command seems to give totals, which I can list in 24 hour slots,
but if I was logged in a short time after midnight and again this morning, I
can't see a way to distinguish either of those periods from the total
available through "ac".

Now I have this using "w":

set user_id to do shell script ("id -un")
set listed_logintime to do shell script "w -h user" & space & user_id
set current_login_hrs to word 5 of listed_logintime
set current_login_mins to word 6 of listed_logintime
set login_secs to (((current_login_hrs * 60) + current_login_mins) * 60)


-- 
Laine Lee
email@hidden
http://lonestar.utsa.edu/llee


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Re: How many seconds since I logged in (From: Jasper Van Proeyen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.