-
Notifications
You must be signed in to change notification settings - Fork 15
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
I can't figure out how to give iCanHazShortcut permission to automate Chrome #27
Comments
Hello. Please create a shortcut with this command: Does it work for you? |
@deseven -- yes that does work for me. Hmmm. |
Then i guess it has nothing to do with iCHS itself. Still, have you tried to launch your python script/program manually (e.g. from terminal)? Does it work that way? |
Thanks @deseven for your fix. I'll take a look at it. BTW, you may have figured it out -- but my Python script does work from the terminal, making me think that the permission issue was related to iCHS. |
It is related after all, i was wrong. It's more like a feature than a bug though, current version spawns non-interactive shell and that's why you don't get that permission request. Invoking a shell with Please report if that test build works for you when you can. |
@MEGADR01D you can check out the new test version too if you want. |
@deseven Thanks. Downloaded, will try later and report back. |
@deseven Thanks, dev version is working great. With the Small glitch on the Preferences window, tho. Open Preferences from the menubar, switch to Shortcuts and edit a shortcut (pencil icon or double click). Looking forward to the next release. Awesome job. |
Alas, the new version still doesn't work for me. I reset my macOS privacy settings (with yet when I go to test my script in iCHS, I still get the same error (with no prompt to give permission). It seems that somehow I must have said no at some point to iCHS in the past and can't figure out how to reset that decision so that I can be given a chance to say yes this time. The script in question is: #!/Users/raymondyee/C/src/my_conda_envs/myenv5/.venv/bin/python
from appscript import app, k, its
import pyperclip
gc = app("Google Chrome")
links = []
for w in gc.windows():
for (i, tab) in enumerate(w.tabs()):
links.append('[{}]({})'.format(tab.title(), tab.URL()))
links_md = "* " + "\n* ".join(links)
pyperclip.copy(links_md) |
Ok, i'll try your script tomorrow. I tested it before with a very simple example:
And it asks for a permission correctly if i run it as |
I tried the simple script that you included here but unfortunately getting the same error in iCHS:
I might have try this on another account or another Mac. |
I don't have much of an understanding of Mojave permission systems but macOS Mojave gets new APIs around AppleEvent sandboxing – but AEpocalypse still looms seems to talk about issues related to the problem I've been experiencing. |
Oh, thanks, your link helped a lot! So this is another security "feature" from Apple that doesn't make any sense (since you can control any app without any permissions using I've added that Please re-download the test version to check if it works for you now. |
@deseven Now it works fine -- thank you so much! Yeah, I really don't understand Apple's security restriction here either. |
Great! I'm closing this then. |
I'm trying to configure iCanHazShortcut to run a script that accesses Chrome via AppleScript (wrapped in Python) but am running into a
error. More fully, the error report is
I don't ever remember getting prompted to give iCanHazShortcut permission to access Chrome, and I'm pretty sure that I would have said yes. I can't seem to set that situation right to give the right permissions now.
My setup:
I've reset System Preferences -> Security & Privacy -> Automation with
but still get the same problem.
Thanks in advance for any help! (and thanks for iCanHazShortcut in the first place)
The text was updated successfully, but these errors were encountered: