Extracting text out of Entourage

Hi all,

I am trying to extract some text out of a Entourage message. This script will be activated by a rule set into Entourage.

Now the message content will look like this:

Now when I place in as text the this script:

to get_values from txt
	set tid to text item delimiters
	set text item delimiters to ": "
	set lst to rest of txt's text items
	set text item delimiters to tid
	repeat with i in lst
		set i's contents to i's text 1 thru paragraph -2
	end repeat
	lst
end get_values

set txt to "This message was sent to you automatically by GI Solutions Group's Secure FTP Server files have been uploaded. 
SFTP Account: Unity Unity
File Name : JUHM0046962_1.Colour.A4_Paper.ctrl 
Event Time : 30 Nov 10 12:16:59
Quota Used : 0
Quota Max : 0
Logon Name : Unity
Remote IP : 84.22.170.245
Protocol : SFTP
Local Port : 22
User can connect using FTP : No
User can connect using SFTP : Yes
"
get_values from txt

it works fine in separating out the text.

Now when I try from a Entourage message:


to get_values from txt
	set tid to text item delimiters
	set text item delimiters to ": "
	set lst to rest of txt's text items
	set text item delimiters to tid
	repeat with i in lst
		set i's contents to i's text 1 thru paragraph -2
	end repeat
	lst
end get_values

to PassOntoNextProcess(txt)
	set txt to txt's text 1 thru word -1 & return (* clean up any trailing paragraphs *)
	set {Account, FileName, EventTime, QuotaUsed, QuotaMax, LogonName, RemoteIP, Protocol, LocalPort, UserFTP, UserSFTP} to get_values from txt
end PassOntoNextProcess

tell application "Microsoft Outlook" to repeat with msg in (get current messages)
	set {contents:txt} to msg
	my PassOntoNextProcess(txt)
end repeat

get_values from txt


It now errors with:

Please can you help me iron this out as it is going to be part of a bigger script.

Cheers
Andy

I managed to sort what I wanted to do with this:


to get_values from txt
	set tid to text item delimiters
	set text item delimiters to ": "
	set lst to rest of txt's text items
	set text item delimiters to tid
	repeat with i in lst
		set i's contents to i's text 1 thru paragraph -2
	end repeat
	lst
end get_values


tell application "Microsoft Entourage" to repeat with msg in (get current messages)
	set {content:txt} to msg
end repeat

get_values from txt
set {Account, FileName, EventTime, QuotaUsed, QuotaMax, LogonName, RemoteIP, Protocol, LocalPort, UserFTP, UserSFTP} to get_values from txt


return FileName

Cheers
Andy