• 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
Time manipulation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Time manipulation


  • Subject: Time manipulation
  • From: Robert Poland <email@hidden>
  • Date: Tue, 5 Jun 2001 18:02:52 -0400

The recent flurry of talk about Time manipulation inspired (and
helped) me to create the following part of my startup script. 12 Hour
clock is assumed.

<Start>
set vDate to (current date)
set timeStr to "" & time string of (vDate)
set text item delimiters to {" "}
set ampm to last text item of timeStr
set text item delimiters to {""}
set timeStr to ((characters 1 thru ((the length of timeStr) - 6) of
timeStr)) as text
set timeStr to timeStr & " " & ampm
set DateString to "" & (vDate) -- month, day, year, time, AM/PM
set the_hourofday to "" & (get word 5 of DateString) as text
set DateString to "" & (vDate)'s month & " " & (vDate)'s day & ", "
& (vDate)'s year -- month, day, year
if ampm = "AM" or ampm = "am" then
ampm = "AE M" -- make it speakable
say "Good morning Robert. It is " & timeStr & ", " & DateString
using "Fred" --Morning
else if the_hourofday is less than 6 then
say "Good afternoon Robert. It is " & timeStr & ", " &
DateString using "Fred" -- afternoon
else
say "Good evening Robert. It is " & timeStr & ", " & DateString
using "Fred" -- evening
end if
<End>

Comments?

--
-
Bob Poland
email@hidden
Check out my garage sale http://www.ibrb.org/


References: 
 >Re: text manipulation (From: cricket <email@hidden>)

  • Prev by Date: Re: startup disk scripting
  • Next by Date: Re: CMYK image editor
  • Previous by thread: Re: text manipulation
  • Next by thread: Re: text manipulation
  • Index(es):
    • Date
    • Thread