Help with an Apple Mail trigger script!

OK, I’ve search everything…

I want to extract the text from a specific kind of email and put something out of it in a FileMake Pro database. This is the script I use and that is correctly called from Mail:

using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		tell application "Mail"
			repeat with eachMessage in theMessages
				set myText to content of eachMessage
				my dispatchContent(myText)
			end repeat
		end tell
	end perform mail action with messages
end using terms from

The dispatchContent function does something to the text, but before it can even begin, I need to log something in a log. So, the first few lines of dispatchContent are looking like this:

on dispatchContent(myText)
		my logText("Entering dispatchContent")

I know that logText is correctly called with the right parameter (the text line). Here’s that (verry…) simple function:

on logText(logItem)
	tell application "FileMaker Pro"
		activate
			open file "Disk:Folder:Folder:ErrorLog.fp5"
			set myRecord to create new record
			set cellValue of cell "Description" of myRecord to ("DIS-" & logItem)
	end tell
end logText

The problem is that I’m not even going through the “tell application” line… What gives? The code is perfectly running when I call dispatchContent from the run function. I’m clueless now…