Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not authorized to send Apple events in Python script #681

Open
ZBiener opened this issue Apr 1, 2021 · 4 comments
Open

Not authorized to send Apple events in Python script #681

ZBiener opened this issue Apr 1, 2021 · 4 comments

Comments

@ZBiener
Copy link

ZBiener commented Apr 1, 2021

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 ZBiener changed the title Not authorized to send Apple events Not authorized to send Apple events in Python script Apr 1, 2021
@matryer
Copy link
Owner

matryer commented Apr 2, 2021

@ZBiener thanks for reporting this. @leaanthony looks like we need to look into entitlements etc.

@leaanthony
Copy link
Collaborator

It looks like we need to get code signing working to allow this.

@ZBiener
Copy link
Author

ZBiener commented Feb 8, 2022

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).

@leaanthony
Copy link
Collaborator

I'll put this on my todo @ZBiener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants