Re: How can I simplify the math in this script?
Re: How can I simplify the math in this script?
- Subject: Re: How can I simplify the math in this script?
- From: Luther Fuller <email@hidden>
- Date: Mon, 16 Jun 2008 18:36:41 -0500
Is this what you are looking for ...
set Launch3G to "July 11, 2008, 6 PM"
repeat
set timeToLaunch to (date Launch3G) - (current date)
set WeeksToLaunch to (timeToLaunch div weeks)
set DaysToLaunch to (timeToLaunch mod weeks) div days
set HoursToLaunch to (timeToLaunch mod days) div hours
set MinsToLaunch to (timeToLaunch mod hours) div minutes
set SecondsToLaunch to (timeToLaunch mod minutes)
display dialog "iPhone 3G will be launched in exactly" & return & ¬
WeeksToLaunch & " weeks, " & DaysToLaunch & " days, " &
HoursToLaunch & " hours, " & MinsToLaunch & " minutes, " &
SecondsToLaunch & " seconds." giving up after 1
end repeat
On Jun 16, 2008, at 5:51 PM, Michelle Steiner wrote:
set Launch3G to "July 11, 2008, 6 PM"
repeat
set timeToLaunch to (date Launch3G) - (current date)
set WeeksToLaunch to timeToLaunch div weeks
set DaysToLaunch to (timeToLaunch - WeeksToLaunch * weeks) div days
set HoursToLaunch to (timeToLaunch - WeeksToLaunch * weeks -
DaysToLaunch * days) div hours
set MinsToLaunch to (timeToLaunch - WeeksToLaunch * weeks -
DaysToLaunch * days - HoursToLaunch * hours) div minutes
set SecondsToLaunch to (timeToLaunch - WeeksToLaunch * weeks -
DaysToLaunch * days - HoursToLaunch * hours - MinsToLaunch * minutes)
display dialog "iPhone 3G will be launched in exactly" & return & ¬
WeeksToLaunch & " weeks, " & DaysToLaunch & " days, " &
HoursToLaunch & " hours, " & MinsToLaunch & " minutes, " &
SecondsToLaunch & " seconds." giving up after 1
end repeat
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden