Define latest - I’m still on Mojave
I fear when I read “Private API”… it looks suspicious to my mind (Man in black…)
The latest documentation for the system that you’re running.
Interesting, I’ve never encountered this, but it sounds like what may be happening.
- is it when the Screen is locked or when the Keychain is locked (is this the same thing?)
- is your app fully code-signed and notarized? (I believe non-signed apps are blocked from doing some HTTP requests by default…)
- does wrapping your email sending routine in calls to NSProcessInfo beginActivity and endAcitivity help? See Monkeybread Xojo plugin - NSProcessInfoMBS methods
Hi Sam and everyone
Great to see the activity here!
I’m leaning toward just trying a method to turn on the Mac in a small window around the time the message sends. Want to keep it as simple as possible!
Some sites that might be helpful:
Send email via terminal
Scheduling Jobs With Crontab on macOS (note that you need to give cron access - this is new since Mojave):
crontab guru: Cron examples - Crontab.guru
Note that (as you can only specify a time range in the 0-23 hour range) you will need TWO cron jobs: one for every hour BEFORE midnight, one for every hour AFTER midnight
In the script that cron executes
– send mail
- get the current time
- create a newtime that is 1 hour later
- set the power manager to wake later: pmset repeat wakeorpoweron MTWRFSU newtime
- put the computer back to sleep
Note: you could also convert your scripts to launchd tasks rather than cron entries.