I was bored . . . .
I was wondering how to do this some time ago and got distracted. Your question made me think of it again, and as I said, I was bored . . .
This is an AppleScript script that should do the trick if you attach it to a Mail rule.
Code:
do shell script "ftp -o /tmp/doppler.jpg http://www.wqad.net/weather/doppler.jpg"
tell application "Mail"
set addrVar to "__YOUR_EMAIL_ADDRESS__"
set subjectvar to "Doppler Update"
tell application "Finder"
set the target_file to (file "Macintosh HD:tmp:doppler.jpg") as alias
set bodyvar to the name of target_file
end tell
set composeMessage to (make new outgoing message)
tell composeMessage
make new recipient at beginning of to recipients with properties {address:addrVar}
set the subject to subjectvar
set the content to bodyvar
tell content
make new attachment with properties {file name:target_file} at after the last word of the last paragraph
end tell
end tell
send composeMessage
end tell
- Open the Script Editor application (Applications:AppleScript:Script Editor).
- Create a New script and paste the above inside.
-
Replace the __YOUR_EMAIL_ADDRESS__ text with your own (or your phone's) email adddress.
-
If your system disk is named something other than "Macintosh HD", make the corresponding change in the set the target_file... line to match the name of the HD in your system.
- Compile the script. Make sure there are no errors.
- If you are curious, you can run it right from the Script Editor to test it. Just hit the "Run" button.
- Save it as a 'Script' somewhere convenient (such as your home Applications folder) and name it something sensible (such as "DoDoppler.scpt").
Now go to the Mail application and add your new rule in the "Preferences" "Rules" pane. Set up the "Condition" to match a string in the "Subject" as you want it, then under "Perform the following actions:" select "Run AppleScript" from the menu on the left, and "Choose" your newly created script on the right.
I hacked some of the script (how to compose a message and add an attachment) from a hint posted on maxosxhints.com, and added the retrieval of your JPG image from the web (first line). The script itself is pretty simple and could be easily customized by anyone who can work the Script Editor.
Worked for me. Hope it works for you.
Boredom put to some use . . .