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

Permissions for running applescripts #41

Open
ivan-unfolds opened this issue May 7, 2019 · 5 comments
Open

Permissions for running applescripts #41

ivan-unfolds opened this issue May 7, 2019 · 5 comments

Comments

@ivan-unfolds
Copy link

@martakostova I was wondering if you can help!

I am trying to add the following applescript so that my computer locks itself at the end of pomodoro period. This is so I can make sure that I take my pomodoro break as I often miss the alarm and next thing I know 3 hours have gone by without a break.

activate application "SystemUIServer"
tell application "System Events"
    tell process "SystemUIServer" to keystroke "q" using {command down, control down}
end tell

However I am getting an error when trying to do this. After doing some research I think the script is failing because the app does not have the right permissions. I am not sure but I think the problem is that it is not in the Automation tab of the Security and Privacy settings.

Screenshot 2019-05-07 at 19 57 23

Do you know if there's anything that can be done?

@martakostova
Copy link
Owner

Yes, this is because of Sandboxing (which is requirement for the App Store). Here you can find instructions how to disable it #19

@ivan-unfolds
Copy link
Author

Thanks for speedy response @martakostova 🙂

#19 didn't work unfortunately, when I changed com.apple.security.app-sandbox boolean, the app wouldn't open. However I found your other suggestions of building the app locally. This didn't work initially, however I added NSAppleEventsUsageDescription to the Pomodoro-info.plist and it worked. Hopefully that is of help for anyone with same issue!

@martakostova
Copy link
Owner

@ivanmauricio this was very useful. Thanks! Will add it in the next version.
Cheers!

@ivan-unfolds
Copy link
Author

No worries, glad I could be of help 😊

As an aside I have been using that script for the last few days and it's worked really well at helping me stick to my breaks. I know you take feature requests, so I think an option to lock your computer at break ends is a good one. Not sure how hard that would be to implement though!

@JosepFrancesc
Copy link

Hi @martakostova ,
I have the same problem with Catalina. Can you help me please?

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