Import Messages from Entourage

I have the following script in Entourage, but would like to change it so it doesn’t import the full header – all I want is what appears with the email by default: From, Date, To, Subject and the full text.

I tried taking out “set theHeaders to headers of theMessage”, and (theHeaders as string), but when I ran compile, I got all sorts of error messages, so I clearly don’t know what I’m doing.

I’d really appreciate a fix for this, and as long as I’m asking for help – is it possible to include an “ask” so I can specify which db and which folder it should go to?

tell application “Microsoft Entourage”
set theSelection to the selection
if the length of theSelection is less than 1 then
display dialog “One or more messages must be selected.” buttons {“OK”} default button 1 with icon caution
repeat with theMessage in theSelection
set theSubject to subject of theMessage
set theSender to (address of sender of theMessage) as string
set theHeaders to headers of theMessage
set theContent to content of theMessage
set theDate to time received of theMessage
if theSubject is equal to “” then set theSubject to pNoSubjectString
tell application “DEVONthink Pro” to create record with {name:theSubject, type:txt, date:theDate, URL:theSender, plain text:(theHeaders as string) & return & (theContent as string)}
end repeat
end if
end try
end tell

The scripts of the v1.0.1 (see folder “Scripts” on disk image) use short headers (From, To, Subject, Date).

Thanks Christian: I upgraded and the script is now working great. Thanks for your help – and for the constant effort to improve a great application; I use it more all the time and keep recommending it to others.