-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
macOS cant run most of Apple Scripts because of UI block #553
Comments
For my specific case I solved the issue with using another tool, https://github.com/sindresorhus/create-dmg |
@Shchvova , thank you for your report and fix. We are looking at the ways to solve this problem globally but not solution and ETA for now. |
That’s alright. To be honest, ability to build open source macOS Apps for free in such a comfortable way is amazing by itself. |
We are experiencing the same issue. Please allow running osascript for Mac actions. Currently the image starts with open Finder windows and some of them are blocking our UI tests.
|
Thank you, so much @miketimofeev! We temporarily went to hosted action and looking forward to return back to GitHub virtual environments. Apple Scripts are huge help for us in macOS test automation. |
Unfortunately, we have found another issue with Apple Script on macOS 10.15 so the fix won't be included in the next week's VM image. |
Thank you, we have a workaround for now to close Finder without Apple Script:
as suggested here: #977 (comment) But we need Apple Script for other tasks in the UI Tests, especially to ability to control other applications. It would be great if osascript would be in the whitelist for Privacy in particular for Screen Recording and Accessibility. Or if we can control Security & Privacy settings or have SIP disabled image. |
@Shchvova @paulz the image with Apple Script support has been successfully deployed. This works fine now:
I'm going to close the issue, but feel free to contact us if you have any concerns. |
Trying to run the Apple Script even with sudo
I am getting timeout error:
@miketimofeev do you have a link to successful run of an apple script? |
@paulz here it is |
@paulz we're currently deploying this vm image, which doesn't include related changes: |
using https://github.com/actions/virtual-environments/issues/553\#issuecomment-648109166 To avoid failure to click button: https://github.com/sparta-science/connect/runs/820484482?check_suite_focus=true#step:12:125 ✗ testAutoUpgrade, Element Button, {{608.0, 279.0}, {165.0, 32.0}}, identifier: '_NS:9', title: 'Install and Relaunch' is not hittable and is not in a scroll view ✗ testUpgradeOnQuit, Element Button, {{586.0, 313.0}, {129.0, 32.0}}, identifier: '_NS:27', title: 'Install on Quit' is not hittable and is not in a scroll view
Thank you, 🙏, confirming it works for me now: on the new version of the Virtual Environment:
Version: 20200625.2
Version: 20200610.3
Hard to notice, but when we rerun previous failure it's still runs on the old image. |
inserting to com.apple.TCC/TCC.db to longer needed as new github mac os image has permissions set see: https://github.com/actions/virtual-environments/issues/553\#issuecomment-653682421
…n order to allows AppleScript automation of Music.app
Hi, I'm using
before running AppleScripts against the Photos.app, but pretty much regardless what I run, I always get a timeout (on
Is it possible that the Photos.app is caught in some sort of "run for the first time" modal dialog and therefore does not react to AppleScripts? Thanks. |
Hi @hendriks73! |
Cool. Please see https://github.com/hendriks73/applescriptphotosworkflow Thank you! |
This is just for demo purposes:
|
@hendriks73 there is an error in the insert query |
Where do you see that error message? The insert statement is a verbatim copy of yours from #553 (comment) - except for the bundle id. And it seems to work really well for other scriptable apps. |
My run (i.e. the logs) of the workflow is here. |
sorry, I've missed the fact that your run is on macOS-10.15 and tried it on macOS-11, where the DB structure is different. Will give it a try on macOS-10.15 |
Sorry, should have mentioned that. If you'd like to do people a favor, please post the equivalent insert statement for macOS 11 here. Would be very much appreciated (at least by me :-) ). |
@hendriks73 probably macOS-11 would be pretty the same except the column. This can be done using this simple apple script
The whole workflow looks something like this
|
Awesome. Thank you for looking into this! I've incorporated the activation script into my actual project https://github.com/hendriks73/japlphoto (Java API for Photos) and it seems to work like a charm. |
@hendriks73 did you ever figure out the NOT NULL constraint failed: access.auth_value |
Describe the bug
I'm trying to build a DMG using GitHub actions, but it involves popular tool create_dmg which utilizes Apple Script.
Problem is, it shows up a request for permissions, which one doesn't even have to be admin to accept. But since
Area for Triage:
Scripting and command line
Apple
Question, Bug, or Feature?:
Bug
Virtual environments affected
Expected behavior
OSAScripts to execute instantly.
One doesn't have to be an admin to allow this, just regular user. Also, once allowed, it will keep the behaviour. May be include this permissions in base image?
Actual behavior
It fails because of timeout, waiting for the GUI. No one there to click the button. This just sad.
Here is example of failing action
It may seem like this is related to the #113, but Full Disk Access is much more dramatic permission to ask, and with full disk access, indeed, one can change contents of the TCC.db, which is sqlite3 database containing permissions, with lots of hacks. But this is rather sub-case, requiring way less intrusion into the OS.
The text was updated successfully, but these errors were encountered: