BlueM / cliclick

macOS CLI tool for emulating mouse and keyboard events
https://www.bluem.net
Other
1.59k stars 116 forks source link

Unable to run on crobtab bash script #103

Closed martinorob closed 4 years ago

martinorob commented 4 years ago

Hi, I’m having issues on running cliclick trough a bash script on crontab. The only way is to call it with osascript calling with terminal

osascript “tell application terminal to launch click.sh”

If i put click.sh on crontab it doesn’t works.

I have cliclick and click.sh and crontab and bash on permission allowed on control panel of Catalina.

May someone help me? Thanks

BlueM commented 4 years ago

Some tasks can simply not be accomplished using crontab. (Other example: reading items from the keychain using security.)

You could try using a Launch Agent – which simply means writing a PList (XML) file. You should be able to find examples and documentation on the web.

martinorob commented 4 years ago

Thanks @BlueM but i think that there is no way to run launch agent every 4 hour (like crontab)

martinorob commented 4 years ago

Wrong. https://www.splinter.com.au/using-launchd-to-run-a-script-every-5-mins-on/

I’ll give it a try

martinorob commented 4 years ago

Works like a charm. I’ve used this to create a plist like a cron job with this http://launched.zerowidth.com/plists

Thanks @BlueM for the hint

kahnchang commented 1 year ago

I have a sh containing cliclick that runs in the crontab of Sierra, but does not work in the crontab of Big Sur.