I am trying to get the emails in my inbox from Microsoft Outlook. I am using appscript library in Python. I am aware that the library is not in active development and I can use Microsoft Graph API to get the email. But currently I just want to do it on my computer. My computer is Macbook Pro with M2 pro chip. My super simple code is below which is not working. By not working I mean I am not getting the current messages and instead getting an error
Code:
from appscript import app, its
outlook = app('Microsoft Outlook')
inbox = outlook.inbox()
messages = inbox.currentMessages()
Error:
k.missing_value
Traceback (most recent call last):
File "/Users/ks/anaconda3/envs/cti-vendor-alerts/lib/python3.11/site-packages/aeosa/appscript/reference.py", line 599, in __getattr__
selectortype, code = self.AS_appdata.referencebyname()[name]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'currentMessages'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/ks/Documents/projects/outlook-automation/python/get_outlook_data.py", line 8, in <module>
print(inbox.currentMessages())
^^^^^^^^^^^^^^^^^^^^^
File "/Users/ks/anaconda3/envs/cti-vendor-alerts/lib/python3.11/site-packages/aeosa/appscript/reference.py", line 601, in __getattr__
raise AttributeError("Unknown property, element or command: {!r}".format(name)) from e
AttributeError: Unknown property, element or command: 'currentMessages'
I am using the class names and properties described in the Objective C documentation of Microsoft Outlook in the dictionary section of the Apple script editor.