I can automate Outlook on windows with win32/COM, but does anyone know of a pure python way to do the same on mac osx?
A simple use case would be:
I want to create an app to create email templates and attach files, then let the user finish editing the email and send when ready, NOT just send emails.
Is there a python wrapper for applescript that may work? (I don't know anything about applescript, so an example would help).
Figured it out using py-appscript
pip install appscript
from appscript import app, k
outlook = app('Microsoft Outlook')
msg = outlook.make(
new=k.outgoing_message,
with_properties={
k.subject: 'Test Email',
k.plain_text_content: 'Test email body'})
msg.make(
new=k.recipient,
with_properties={
k.email_address: {
k.name: 'Fake Person',
k.address: '[email protected]'}})
msg.open()
msg.activate()
Also very useful to download py-appscript's ASDictionary and ASTranslate tools to convert examples of AppleScript to the python version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With