0

I aim to use cron to call a python script that changes my desktop background. The key python line is as follows:

from appscript import mactypes, app
app('Finder').desktop_picture.set(mactypes.File(chosen_pic))

When running said script from Terminal, the program runs, but when called by cron, this line gives an error that appears via mail. Experimentation yielded that running from Terminal gives the same error when its permission to edit Finder is unchecked here:

enter image description here

It seems likely that if I could give cron permission to control Finder in this way, that'd solve the problem, but cron's not on this list, and I don't see a way to add it. By contrast, the Full Disk Access pane lets one add new programs, but adding cron doesn't solve this. If it helps, this is on Catalina 10.15.5.

How can one add a new app to the Automation pane here and give it permission to control another app?

Thank you!

3
  • 1
  • Thanks - I've given cron full disk access, but that didn't help. Is it plausible that giving an app permissions under Automation would grant powers that aren't included in Full Disk Access? – mrfish Jul 23 '20 at 15:04
  • Remember that your cron job is not recognized as your user id when it executes. Also remember its environment differs from yours (thus full paths are often required). You might try setting up a root crontab: i.e. sudo crontab -e, and try running your script from there. Finally, and FWIW, I've largely abandoned cron on my Mac in favor of LaunchControl – Seamus Jul 24 '20 at 0:46

You must log in to answer this question.

Browse other questions tagged .