Nov 21, '03 11:24:00AM • Contributed by: joshuajestelle
% open -a MailThis allows you to quickly send a file via email from your command line.
|
|
|
Attach a file to a new Mail message from the Terminal
Nov 21, '03 11:24:00AM • Contributed by: joshuajestelle
I found the following command useful to attach a file to an outgoing mail message:
% open -a MailThis allows you to quickly send a file via email from your command line.
•
[9,049 views]
Hint Options
open -a Mail
I guess you meant to write:
open -a mail [filename]
Come to think of it, it's rather obvious, but I never thought about this. Unfortunately, it seems to attach multiple files to multiple messages, as in GUI:
open -a mail [filename1] [filename2]
(Creates two new messages)
open -a Mail
Any way to pass other parameters such as to, subject, etc.
open -a Mail
Not with "open". You're better off using AppleScript for this sort of thing. You can use the "osascript" command to run arbitrary scripts from the command line. Apple has a good script for this in a Q&A document, but if you want something quick, you might try something like this:
This will create a new message, but it won't send it. If you want to send the message automatically, change "set visible to true" to "send".
mailto:
Well, if Mail.app's your default mailreader, it accepts mailto: links so maybe there's a way to do this using a browser...
Yup, it works: open -a Safari mailto:[address]
mailto:
Well, if Mail.app's your default mailreader, it accepts mailto: links so maybe there's a way to do this using a browser...
Yup, it works: open -a Safari mailto:[address]
Attach a file to a new Mail message from the Terminal
This inspired me to try
Attach a file to a new Mail message from the Terminal
You don't need to "tell safari" to do it.
works just fine as well.
Attach a file to a new Mail message from the Terminal
Do a
man open to get a description for open. The description is short and helpful.
Attach a file to a new Mail message from the Terminal
it doesn't open necessarily safari, it takes your default browser, for me these commands open OmniWeb.
Attach a file to a new Mail message from the Terminal
This is a little quicker: (all on one line) osascript -e 'tell application "Safari" to make new document with properties {URL:"http://www.apple.com/"}'
Attach a file to a new Mail message from the Terminal
Hmm. I meant that to be in reply to mat1's osascript example. Dunno how it got tacked to the wrong thread, oh well... |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.59 seconds |
|