从剪贴板发送电子邮件而无需打开 mail.app [英] Send email from clipboard without opening mail.app
问题描述
我搜索了如何在不打开苹果邮件的情况下发送电子邮件,并发现了问题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
但是,我使用 Keyboard maestro 执行此操作,以便我可以在任何应用程序中使用热键发送特定电子邮件.在谷歌搜索解决方案后,我发现这个脚本可以很好地完成工作:
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
结束告诉
一个问题:我想这样做,但不是主题中的hello,我想要剪贴板.谷歌搜索,我发现了两件事
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)
我试着用那两个代替你好".但它们都不起作用.
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屋!