Posts Tagged ‘importing messages’

Script to pipe emails into Yojimbo

Monday, September 4th, 2006

YojimboJim Correia of Bare Bones Software has posted a script to the Yojimbo mailing list that will pipe a selected email from Mail.app into Yojimbo.

This is handy (a) if you use Yojimbo and (b) like me, you find it a bit of a pain to import emails with the “Save PDF to Yojimbo” option in the PDF section of the Print dialog.

The script will import the contents of the email and the sender, subject and date into a new Yojimbo note:

Mailtoyojimboscreenie

You can copy the text here:

on generateMessageText(m)
tell application “Mail”
set _sender to sender of m
set _subject to subject of m
set _date to date received of m as string
set _contents to content of m
set _messageString to “From: ” & _sender & return
set _messageString to _messageString & “Subject: ” & _subject & return
set _messageString to _messageString & “Date: ” & _date & return
set _messageString to _messageString & return & return & _contents
end tell
end generateMessageText

on run
tell application “Mail”
tell message viewer 1
set messageList to selected messages
set _name to subject of item 1 of messageList
set _contents to “”
repeat with m in messageList
set _contents to _contents & my generateMessageText(m)
end repeat
tell application “Yojimbo”
make new note item with properties {contents:_contents, name:_name}
end tell
end tell
end tell
end run

Or use this pre-complied version. Save it into the same place as the rest of your mail scripts, maybe give it a keyboard short-cut with FastScripts Lite or set a Quicksilver trigger for it or attach it to a Mail Act-on rule, and you’re done.

Nifty. A big thanks to Jim.

  • Digg
  • Facebook
  • Delicious
  • StumbleUpon
  • Evernote
  • Share/Bookmark
Tags: , , , , , , ,