Title: Re: Seeing sender's time zone
My "Show local time sent" script has been enhanced now to include displaying some of the major cities in the sender's time zone, e.g.:

The time sent was
Date: Tue, 30 Jan 2001 22:56:59 -0800 in the zone of
Los Angeles/Portland
for msg: Re: New Note from Selected Text (trying to write)

or

The time sent was
Date: Wed, 31 Jan 2001 09:03:11 +0900 in the zone of
Tokyo
for msg: Seeing sender's time zone

So, now you can quickly tell what part of the world a person is writing from as well as what time it is where they are.

Here is the simple script:

(*
Show local time sent
Allen Watson <[EMAIL PROTECTED]>
Wed, Jan 31, 2001
--Select one or more incoming messages in Entourage. This script will show the sender's local time at which the message was sent, and will tell you one or more major cities in their time zone, so you can tell what part of the world they were in.
*)

--Following list of cities should be all on one line in the script
property timeZoneCities : {"<Pacific Ocean>", "Honolulu", "Anchorage", "Los Angeles/Portland", "Denver", "Chicago/Mexico City", "New York/Havana/Lima", "San Juan/Santiago/Nova Scotia", "Rio De Janero/Buenos Aires", "South Sandwich Islands", "Reykyivik/Azores", "London/Dakar", "Paris/Berlin/Lagos", "Kiev/Cairo", "Moscow/Bagdad/Nairobi", "Abu Dabi/Tehran", "Karachi", "New Delhi", "Middle of Nowhere in Asia", "Beijing/Hong Kong/Perth", "Tokyo", "Sydney", "<Pacific Ocean>", "Auckland"}

tell application "Microsoft Entourage" --
    set currentMessages to the current messages --
    repeat with theMsg in the currentMessages --
        my ProcessMsg(theMsg) --
    end repeat --
end tell --

on ProcessMsg(theMsg) --
    tell application "Microsoft Entourage" --
        set thesub to subject of theMsg
        set h to the headers of theMsg
        set h to paragraphs of h
        set dateHeader to ""
        repeat with aLine in h
            if aLine starts with "Date:" then
                beep
                set dateHeader to aLine
                exit repeat
            end if
        end repeat
        if dateHeader is not "" then
            set GMToff to (((text -5 thru -1 of dateHeader) as number) / 100) + 12
            if GMToff = 18 then set GMToff to 19
            set cityInZone to item GMToff of timeZoneCities
            display dialog "The time sent was" & return & dateHeader & " in the zone of " & cityInZone & return & "for msg: " & thesub
        else
            display dialog "Local time was not found."
        end if
    end tell --
end ProcessMsg --

Reply via email to