I want to create a script where i enter a length of time i will be away, say 2 hrs, and then take that time and count down, displaying the time left in my iChat status message.
set the_time to (current date)
display dialog "Enter the number of hours you will be gone." default answer "" buttons {"Cancel", "OK"} default button 2
copy the result as list to {button_pressed, text_returned}
set away_time to the text_returned * 3600
set return_time to the_time + away_time
set blah to return_time as string
display dialog blah
this is what i have so far, basically it ask for the time you will be gone for, then displays what time that you will return. now i just need to make the timer and get it in the status message…any help?
ok, got most of it done. the only thing i need now is to convert time in seconds, say 7200 (2 hrs), into a date format, ie 2:00:00
well, i have two things that you can use. The first (download here ), lets you input a time to count down to (i.e. you enter 4:30 PM). the second (dl here) is a script that will convert a number of hours (i.e. 2) to hrs:min:sec format. i hope that helps you out.
- Sam
P.S. For the downloads, you have to right-click and choose “save as”
By the way, i have an app which integrates this, but it is an alarm, not a status message thing. check it out at http://www.macupdate.com/info.php/id/15322