├── Mail.applescript ├── Original.applescript └── README.markdown /Mail.applescript: -------------------------------------------------------------------------------- 1 | -- Mail.applescript -- iCal -- !!! Note that this script is not compiled by iCal.xcodeproj, which uses a compiled version instead -- !!! so changes to this file will not be reflected in iCal behavior unless manually recompiled. -- (Not compiled because of osacompile fails in a chrooted environment) on send_mail_sb(subjectLine, messageText) tell application "Sparrow" activate set theMessage to make new outgoing message with properties {subject:subjectLine, content:messageText} tell theMessage compose end tell end tell end send_mail_sb on send_mail_sbr(subjectLine, messageText, myrecipient, myrecipientname) tell application "Sparrow" activate set theMessage to make new outgoing message with properties {subject:subjectLine, content:messageText} tell theMessage make new to recipient at end of to recipients with properties {name:myrecipientname, address:myrecipient} sendmessage end tell end tell end send_mail_sbr on send_mail_sbrp(subjectLine, messageText, myrecipient, myrecipientname, invitationPath) set pfile to POSIX file invitationPath set myfile to pfile as alias tell application "Sparrow" activate set theMessage to make new outgoing message with properties {subject:subjectLine, content:messageText} tell theMessage make new to recipient at end of recipients with properties {name:myrecipientname, address:myrecipient} make new mail attachment with properties {filename:myfile} sendmessage end tell end tell end send_mail_sbrp on send_mail_sbp(subjectLine, messageText, invitationPath) set pfile to POSIX file invitationPath set myfile to pfile as alias tell application "Sparrow" activate set theMessage to make new outgoing message with properties {subject:subjectLine, content:messageText} tell theMessage make new mail attachment with properties {filename:myfile} compose end tell end tell end send_mail_sbp -------------------------------------------------------------------------------- /Original.applescript: -------------------------------------------------------------------------------- 1 | -- Mail.applescript 2 | -- iCal 3 | 4 | on show_mail_sbrs(subjectLine, messageText, myrecipients) 5 | tell application "Mail" 6 | set mymail to (make new outgoing message at the beginning of outgoing messages with properties {subject:subjectLine, content:messageText}) 7 | repeat with i from (count of myrecipients) to 1 by -1 8 | tell mymail to make new to recipient at beginning of to recipients with properties {address:(item i of myrecipients)} 9 | end repeat 10 | set visible of mymail to true 11 | activate 12 | end tell 13 | end show_mail_sbrs 14 | 15 | on show_mail_sbr(subjectLine, messageText, myrecipient, myrecipientname) 16 | tell application "Mail" 17 | set mymail to (make new outgoing message at the beginning of outgoing messages with properties {subject:subjectLine, content:messageText}) 18 | tell mymail to make new to recipient at beginning of to recipients with properties {address:myrecipient, name:myrecipientname} 19 | set visible of mymail to true 20 | activate 21 | end tell 22 | end show_mail_sbr 23 | 24 | on send_mail_sb(subjectLine, messageText) 25 | tell application "Mail" 26 | set mymail to (make new outgoing message at the beginning of outgoing messages with properties {subject:subjectLine, content:messageText}) 27 | set visible of mymail to true 28 | activate 29 | end tell 30 | end send_mail_sb 31 | 32 | on send_mail_sbr(subjectLine, messageText, myrecipient, myrecipientname) 33 | tell application "Mail" 34 | set mymail to (make new outgoing message at the beginning of outgoing messages with properties {subject:subjectLine, content:messageText}) 35 | tell mymail to make new to recipient at beginning of to recipients with properties {address:myrecipient, name:myrecipientname} 36 | send mymail 37 | end tell 38 | end send_mail_sbr 39 | 40 | on send_mail_sbrp(subjectLine, messageText, myrecipient, myrecipientname, invitationPath) 41 | set pfile to POSIX file invitationPath 42 | set myfile to pfile as alias 43 | tell application "Mail" 44 | set mymail to (make new outgoing message at the beginning of outgoing messages with properties {subject:subjectLine, content:messageText}) 45 | tell mymail to make new to recipient at beginning of to recipients with properties {address:myrecipient, name:myrecipientname} 46 | tell mymail 47 | tell content 48 | make new attachment with properties {file name:myfile} at after the last word of the the last paragraph 49 | end tell 50 | end tell 51 | send mymail 52 | end tell 53 | end send_mail_sbrp 54 | 55 | on send_mail_sbp(subjectLine, messageText, invitationPath) 56 | set pfile to POSIX file invitationPath 57 | set myfile to pfile as alias 58 | tell application "Mail" 59 | set mymail to (make new outgoing message at the beginning of outgoing messages with properties {subject:subjectLine, content:messageText}) 60 | tell mymail 61 | tell content 62 | make new attachment with properties {file name:myfile} at after the last word of the the last paragraph 63 | end tell 64 | end tell 65 | set visible of mymail to true 66 | activate 67 | end tell 68 | end send_mail_sbp 69 | 70 | 71 | 72 | property ASDScriptUniqueIdentifier : "Mail.applescript" -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | ## The Problem: 4 | 5 | whenever you have an e-mail reminder set in one of your calendar entries iCal will launch Apple Mail to send you this reminder. Even-though you might not be using Apple Mail. This is especially annoying if you have never even opened or set-up mail and therefor have no e-mail accounts there. Luckily this behavior is modifiable trough Applescript. 6 | 7 | See the accompanied [blog post](http://gidogeek.com/post/6037637963/ical-sparrow) for why I made this. 8 | 9 | ## How to install: 10 | 11 | 1. Download the Mail.applescript file 12 | 2. Make a back-up of : "/Applications/iCal.app/Contents/Resources/Scripts/Mail.scpt" 13 | 3. Open the Mail.applescript file in **"AppleScript Editor"**. It's pre-installed on OSX in: **"/Applications/Utilities/"** 14 | 4. Click compile 15 | ![screenshot](http://f.cl.ly/items/2R0h2M3Z3h1J1b0R3C2i/Screen%20shot%202011-05-31%20at%2019.36.20%20.png) 16 | 5. Rename the file to **Mail.scpt** and copy it to **"/Applications/iCal.app/Contents/Resources/Scripts/"**. Replace the file which is there. 17 | 18 | Note: The Original.applescript is the original applescript file that came with Snow Leopard. 19 | 20 | ## Credits: 21 | 22 | Major love to [@dinh_viet_hoa](http://twitter.com/dinh_viet_hoa) for making Sparrow and of course the Apple Script interface 23 | 24 | ## Help & Issues: 25 | 26 | I realize not everybody who lands on this page might have a Github account. Please feel free to ask me questions about this on [Twitter](http://twitter.com/gidogeek). I'll be more then happy to help you out with any issues you might have. This problem has been bugging me for-ever. --------------------------------------------------------------------------------