Here's another script - rather than use the 'time received', it will scan
through the message and use the time of the first 'received' header in the
email, which is normally only a second or two after the message was sent.
-- Correct the date v1.0 25th June 2002
-- a script for Microsoft Entourage by Barry Wainwright
-- Resets the date of messages to the date of the first received header
-- useful for messages with badly formatted (or just plain wrong) dates
tell application "Microsoft Entourage"
set theMessages to current messages
if theMessages is {} then
display dialog "No messages selected!" buttons {"Stop"} default
button 1 with icon stop
return -99
end if
repeat with theMess in theMessages
set theHeaders to the headers of theMess
set AppleScript's text item delimiters to {return & space}
set theHeaders to text items of theHeaders
set AppleScript's text item delimiters to {space}
set theHeaders to theHeaders as string
set AppleScript's text item delimiters to {return & tab}
set theHeaders to text items of theHeaders
set AppleScript's text item delimiters to {space}
set theHeaders to theHeaders as string
set theHeaders to the paragraphs of theHeaders
set receivedHeader to ""
repeat with aHeader in theHeaders
if aHeader starts with "Received:" then copy contents of aHeader
to receivedHeader
end repeat
set AppleScript's text item delimiters to {";"}
set theDate to (last text item of receivedHeader)
set time sent of theMess to date theDate
end repeat
end tell
--
Barry Wainwright
Microsoft MVP (see
http://mvp.support.microsoft.com for details)
Seen the Entourage FAQ pages? - Check them out:
<
http://www.entourage.mvps.org/toc.html>
Please post responses to this newsgroup. If I ask you to contact me
off-list, remove '.INVALID' from email address before replying.