从剪贴板发送电子邮件,而无需打开mail.app [英] Send email from clipboard without opening mail.app
问题描述
我搜索了如何发送电子邮件,而无需打开邮件的苹果,发现问题<一href=\"http://stackoverflow.com/questions/8767884/applescript-how-to-send-a-email-without-the-mail-app-opening-up\">AppleScript - 如何发送电子邮件没有邮件应用开放
I searched for how to send email without opening apple mail, and found the question AppleScript - How to send a email without the mail app opening up
不过,我用键盘大师这样做,这样我就可以发送使用在任何应用程序的热键特定的电子邮件。使用Google的解决方案后,我发现这个脚本,没有工作得好:
However, I'm doing this with Keyboard maestro, so that I can send a specific email using a hot key in any application. After googling for the solution I found this script that does the job well:
tell application "Mail"
set theNewMessage to make new outgoing message with properties {subject:"hello", content:"You got a new file in your Downloads folder, girl!", visible:true}
tell theNewMessage
make new to recipient at end of to recipients with properties {address:"myemail@mail.com"}
send
end tell
末告诉
问题一:我想这样做,但不是的你好的的问题,我想有剪贴板即可。谷歌搜索,我发现了两件事情。
One problem: I want to do this, but instead of hello in the subject, I want to have the clipboard. Googling for that, I found two things
keystroke "v" using {command down}
或
return (the clipboard)
我试图teplace你好与这两个。但他们没有工作。
I tried to teplace "Hello" with those two. But none of them work.
我不知道的AppleScript,从而围绕谷歌搜索和我的问题在这里。
I don't know applescript, thus googling around and my question here.
推荐答案
这为我工作:
set a to "myemail@mail.com"
tell application "Mail"
tell (make new outgoing message)
set subject to (the clipboard)
set content to "content"
make new to recipient at end of to recipients with properties {address:a}
send
end tell
end tell
这篇关于从剪贴板发送电子邮件,而无需打开mail.app的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!