an applescript that deletes the headers and ...

I am looking for a way to delete all header and footers in an email and paste the text into macJournal. What is the applescript code that can do this?
Thanks in advance.
Cheers,
denns

It might help if you tell us which email client you are using. Do you know for sure that macJournal is scriptable?

I am using mail and I am calling a system event for macJournal to paste into a new window. As far as I know macJournal is not scriptable. All I need to do is copy the email (minus the headers and footers) to the clipboard and then I can call system events to paste into a new window.

Thanks for your reply. I

This appears to get the content of the front message, or the first message when several messages are selected. Maybe you can work out how to handle footers since I’m not aware of a standard way to recognize them programatically.

tell application "Mail"
	set selection_ to selection
	set contents_ to content of item 1 of selection_
end tell

Thanks for the code. It works fine. But what I am trying to do is get the email minus the headers into the clipboard and I have no idea how to do it since I am in the process of learning applescript.

cheers

Maybe this will work. :slight_smile:

tell application "Mail"
	set selection_ to selection
	set content_ to content of item 1 of selection_
end tell

set the clipboard to (content_ as string)

Mr. Jorgenson,
Thanks alot. That script works perfectly.

Cheers