开发者

Using AppleScript to send mail attachment through default email client

开发者 https://www.devze.com 2023-01-06 21:34 出处:网络
Is it possible in any way to send an email attachment through the user\'s default email client using AppleScript? I\'m assuming there is no easy way of doing this, as the programs themselves have to i

Is it possible in any way to send an email attachment through the user's default email client using AppleScript? I'm assuming there is no easy way of doing this, as the programs themselves have to implement AppleScript and every email client will implement it differently and require a different script for sending an email with an attachment.

I've searched around and only foun开发者_如何学编程d this: http://macscripter.net/viewtopic.php?id=12463

Which can, via Applescript, give me the name of the default email client. Has anyone looked into this before?

Thank you.


You are correct. You'll have to implement different applescript code for each email client. As such you'll probably want to limit the email clients your application will support and make that clear to your users.

The only other way for it to work universally is for you to implement your own email system. I have a python script that I can call from an applescript using "do shell script" to send emails. Of course you'll need to know the user's information (smtp server, username, etc). If you're interested you can see my python script here. It doesn't handle attachments but some google searching should show you how to modify it.

0

精彩评论

暂无评论...
验证码 换一张
取 消