The following should work (both as a rule action and when run from the script editor - it will then print all selected messages). I don't consider it to be pretty but since there is no real "print" action available, it will have to do for now...
Please also give Apple feedback that they should add a proper "print" command to both, the rule actions and AppleScript:
http://www.apple.com/macosx/feedback/
<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; padding: 0.2em; font-size: 10px; width:500px">on run
tell application "Mail" to set selectedMessages to get selection
using terms from application "Mail"
perform mail action with messages selectedMessages
end using terms from
end run
using terms from application "Mail"
on perform mail action with messages selectedMessages
tell application "Mail"
repeat with eachMsg in selectedMessages
set theSource to source of eachMsg as text
set AppleScript's text item delimiters to "<HTML>"
try
set theSource to text items 2 thru -1 of theSource as text
on error
set AppleScript's text item delimiters to "<html>"
try
set theSource to text items 2 thru -1 of theSource as text
on error
exit repeat
end try
end try
set AppleScript's text item delimiters to "</HTML>"
set theSource to text item 1 of theSource as text
set AppleScript's text item delimiters to "</html>"
set theSource to text item 1 of theSource as text
tell application "Finder" to set theFileName to ((path to desktop folder as text) & "Mail_tmp.html")
set theFile to open for access theFileName with write permission
set eof of theFile to 0
write "<html>" & return & theSource & "</html>" to theFile starting at eof
close access theFileName as file specification
tell application "Finder"
get properties of alias theFileName
-- make sure that the file will be opened by a browser…
set file type of alias theFileName to "HTML"
set creator type of alias theFileName to " "
print alias theFileName
delete alias theFileName
end tell
end repeat
end tell
end perform mail action with messages
end using terms from</pre>
Andreas
PB G4 Al 1.5GHz/1.25GB, PB G4 Ti 550MHz/768MB, iPod 10GB (2. Gen), AEBS & AEX Mac OS X (10.4.4) http://homepage.mac.com/aamann/