Permalink
Browse files

Checkin' in

  • Loading branch information...
0 parents commit f6115a32afbaf6af5a72f64c3f19112d246dd60d @eelco committed Jun 7, 2008
Showing with 31 additions and 0 deletions.
  1. +31 −0 mailfile
@@ -0,0 +1,31 @@
+#!/usr/bin/osascript
+
+on run argv
+ if argv is {} then
+ return "Pass at least one filename as an argument!"
+ end if
+
+ set pwd to system attribute "PWD"
+
+ tell application "Mail"
+ try
+ set composeMessage to first outgoing messages where visible is equal to true
+ on error
+ set composeMessage to make new outgoing message at beginning with properties {visible:true}
+ end try
+
+ tell composeMessage
+ repeat with fileName in argv
+ if not fileName starts with "/" then
+ set fileName to pwd & "/" & fileName
+ end if
+ tell content
+ make new attachment with properties {file name: fileName} at after the last paragraph
+ end tell
+ end repeat
+ end tell
+
+ activate
+
+ end tell
+end run

0 comments on commit f6115a3

Please sign in to comment.