xbar
xbar copied to clipboard
Not authorized to send Apple events in Python script
I have a python script that calls an applescript using py-applescript (https://github.com/rdhyee/py-applescript). That applescript queries OmniFocus for a variety of data.
The python script runs from the command line with no problem.
However, from xbar, it generates the following error (with some fluff truncated): "
exit status 1: Traceback (most recent call last): ... ... File "....pyenv/versions/3.8.1/lib/python3.8/site-packages/py_applescript-1.0.1-py3.8.egg/applescript/init..py", line 90, in run File "....pyenv/versions/3.8.1/lib/python3.8/site-packages/py_applescript-1.0.1-py3.8.egg/applescript/init..py", line 65, in _unpackresult applescript.ScriptError: Not authorized to send Apple events to OmniFocus. (-1743) app='OmniFocus' range=140-191
I've checked the Security preferences pane, to make sure that the xbar has all possible automation privileges. Right now, the only checkboxes available under xbar are "Audirvana.app" and "System Events.app" (both of which I expect to be there). I also call Audirvana using applescript, but that applescript is embedded in a bash script, not a python script that uses py-applescript.
It seems like some permissions are not being granted 'through' xbar and python, but since the script runs OK from the command line, I don't really know how to troubleshoot further. Ideas?
Thanks.
@ZBiener thanks for reporting this. @leaanthony looks like we need to look into entitlements etc.
It looks like we need to get code signing working to allow this.
Code signing seems to have been taken care of (right?), but I still get the same errors. Are there any other suggestions for where I might look to solve this? Thanks. (FWIW, the old BitBar does not generate the same errors).
I'll put this on my todo @ZBiener