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

Cliclick not doing anything in an Applescript saved as an application #185

Open
2oh1 opened this issue Nov 5, 2024 · 2 comments
Open

Cliclick not doing anything in an Applescript saved as an application #185

2oh1 opened this issue Nov 5, 2024 · 2 comments
Labels

Comments

@2oh1
Copy link

2oh1 commented Nov 5, 2024

Cliclick works in an Applescript. The pointer moves where expected and keys trigger as expected, but it's not doing anything if I save that Applescript as an application. I don't get any errors when I run the script though. Instead, it seems that the cliclick commands are just ignored.

I've gone into system settings / privacy / accessibility, and added the application & toggled it on.

What else do I need to do to fix this?

I've used cliclick in Applescript apps for years. I assume this is a Sequoia issue. Maybe even a Sequoia 15.1 issue.

Any ideas?

@DavidMBrown
Copy link

I've run into a few issues where an AppleScript with cliclick works when run in Script Debugger but not as an application itself. Many times the problem is just a timing issue between the movement of the cursor and the click. You can try using an easing in cliclick or break up the cliclick command into move, wait, click. Another thing I would check is that your $PATH's haven't somehow changed; with 'do shell script' commands in AppleScript apps I use /usr/local/bin/cliclick explicitly. I hope this helps.

@BlueM
Copy link
Owner

BlueM commented Nov 10, 2024

When I try that (on macOS 14), I experience the same: works in Script Editor, doesn’t work when saved as an application – even after granting accessibility permissions. And while the application does not seem to do anything, in Console.app, a bunch of messages “Sender is prohibited from synthesizing events” are logged, so it is in fact a permission issue.

What you can try to do (and what fixed the problem for me) is resetting the permissions:

# Get bundle ID of saved application
grep -A 1 CFBundleIdentifier /path/to/your/Script.app/Contents/Info.plist 

# Then, copy the bundle ID (in my case: com.apple.ScriptEditor.id.Test)
# and use it in this command:
tccutil reset AppleEvents com.apple.ScriptEditor.id.Test

If that doesn’t help, you could try tccutil reset All, but be warned that you will have to grant all permissions again afterwards.

@BlueM BlueM added the question label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants