Simple triggered script to retrieve the first line of text in Mail.

Hi …

I’ve been trying “ all morning - to create a simple Applescript to get the first line of text from all unread emails in a specific Mailbox. I’ve tried about a dozen webpages with sample scripts, but they’re all outdated (pre-Snow Leopard), and none work with my version of Mail (4.5)… surely it can’t be that hard!?

My requirements are this:

  1. An email is received
  2. A rule moves this to a specified Mailbox
  3. A a script is called to get the first line of the email

I then wish to use this line to append to a file name.

Any help would be much appreciated.

AppleScript: 2.1.2
Browser: Safari 533.20.27
Operating System: Mac OS X (10.6)