PaperCutSoftware / teleportme

Connect people through a portal - Transport your inter-offices, meeting room, or common area communication across large distances with an automated FaceTime video portal.
http://papercutsoftware.github.io/teleportme/
MIT License
49 stars 8 forks source link

osascript not allowed assistive access #15

Closed macjustice closed 8 years ago

macjustice commented 9 years ago

osascript needs to be granted Accessibility access for it to control GUI elements. Tried following the guidance here to add it to the accessibility database, with no luck.

xm0dz commented 9 years ago

@macjustice I experienced the same issues as above. Hopefully there is a work around.

squashedbeetle commented 9 years ago

hi @macjustice and @xm0dz - I was just trying to recreate what you're both seeing - when I run the script for the first time on a Yosemite machine, I get a message asking me to add 'Terminal' to the accessibility access under System Preferences -> Security and Privacy -> Privacy -> Accessibility.

Once I allow Terminal to control the computer, then the script runs happily.

Are you able to add 'Terminal' to the accessibility options and see if that works for you? Otherwise, can you send a couple of screenshots of what you've got currently in the Privacy pane, and what you're seeing in Terminal when you run the script please? I can then see if I can get that same behavior happening!

If adding 'Terminal' to the privacy pane fixes it, then I'll get that added to the installation instructions too, to make that more clear!

xm0dz commented 9 years ago

@squashedbeetle and @macjustice I have a couple machines running 10.10.3.

One one machine, adding 'Terminal' to the privacy pane has allowed it to work for quite some time. On the two other machines recently imaged and running 10.10.3, adding 'Terminal' to the privacy pane does not work. It doesn't seem to make sense. The same EXACT script runs fine on one machine but does not on the other two machines with the same OS version and same accessibility settings.

I also use another piece of software called Keyboard Maestro and, in their notes on their troubleshooting page, they also cite issues with accessibility. From http://wiki.keyboardmaestro.com/Troubleshooting

"Yosemite and Accessibility Settings Problems

Yosemite (10.10 GM1 through 10.10.2) has a serious problem adding applications to the accessibility pane properly. This is affecting other applications that require accessibility as well. It seems to commonly impact Keyboard Maestro by the Keyboard Maestro Engine not being added to the accessibility settings pane.

This bug was finally resolved in Yosemite 10.10.3. So if you are having problems with accessibility under Yosemite, upgrade to 10.10.3, and then launch Keyboard Maestro. Then ensure both Keyboard Maestro and Keyboard Maestro Engine are listed and checked.

If you continue to have problems after that, you will need to try resetting your accessibility list and restarting, and then relaunching Keyboard Maestro and trying the process again."

I have not yet had a chance to reset the accessibility list per their suggestion but will report back if that has any success.

As for what I'm seeing in Terminal when I run the script, it just stays stuck at trying to dial out with the "Waiting for call from XXX to open portal". The call isn't initiated in facetime at all. It's not even waiting for the GUI to click to call. It's stuck right before that with facetime open and waiting for someone to be called.

squashedbeetle commented 9 years ago

Hi @xm0dz - yep, I ran into that exact same issue with Keyboard Maestro too when Apple first released Yosemite - I'm also a Keyboard Maestro fan : )

I'll do a bit more digging to see if I can find out what's going on here with the permissions. Just to confirm - you mentioned that Terminal is stuck saying "Waiting for call from XXX to open portal" - so is that mac that you're having issues with the caller or the receiver? The message suggests that it's the receiver? If so, is the 'caller' end actually calling that mac successfully?

Or is it both 'sides' of the call that won't work - i.e. when configured as the caller, it's not calling out even with Terminal and osascript listed in the accessibility options list?

xm0dz commented 9 years ago

@squashedbeetle

"Or is it both 'sides' of the call that won't work - i.e. when configured as the caller, it's not calling out even with Terminal and osascript listed in the accessibility options list?"

Yep! That's what was happening. Neither side functioned regardless of whether it was caller or receiver.

The problem here, which @macjustice , was attempting to rectify in his OP was trying to get osascript into the accessibility list. Terminal can be added no problem but osascript, shell scripts, and other non "apps" can't be added to the list without doing some workaround like shown in OP's post above unless the system prompts you for access when something like 'System Events' needs access. http://jacobsalmela.com/os-x-yosemite-osascript-enabling-access-assistive-devices/

Fortunately, I was able to get everything working so far by re-imaging the machine with a slightly different 10.10.3 image that we have at the office and simply adding 'Terminal' to the accessibility list. I was using a different 10.10.3 image that had worked before in the past but something must have been changed in our internal image that broke it since the last time I attempted to put together one of these machines.

That said, my issue is resolved but I'm still stumped as to why osascript can't be added easily to the accessibility list and if there is any easy work around for when that is required apart from what the OP linked to(which I couldn't get to work anyway). If I figure out what the differences between the two images that I've used are and I find a correlation to accessibility access, I will update here for everyones benefit.

squashedbeetle commented 9 years ago

Thanks @xm0dz - yep that makes sense. I'd definitely be interested to hear if you do find the difference between the builds - overnight I tried on a VM rolled-back to an install of 10.10.3 (upgraded from 10.10.2) - as well as as 'clean' install fresh 10.10.3.

On both of them I only needed to add Terminal to the accessibility pane to allow it to automatically place the call successfully. Very odd!

Please let us know if you find anything - in the meantime we'll keep our eyes open here to see if there are any other solutions!

xm0dz commented 9 years ago

@squashedbeetle I never found out what the difference between builds was but it has mostly worked fine for me since switching to the new build.

After running the script many, many times, on one boot, the terminal returned an error saying something about the script not having access to OSA script and wouldn't let it run. I simply rebooted the machine and all was good again. Weird.

alecthegeek commented 9 years ago

So we can close this?

macjustice commented 9 years ago

Close it down. Thanks for checking it out.