at command with osascript broken after Mojave
I had a script as simple as this on a .sh file:
echo 'osascript -e \"display notification "Warning after a minute\""' | at now +1 minute
After upgrading to Mojave the script was no longer working, it doesn't work even on the terminal. I get no error messages, the notification simply don't show up after the scheduled time is reached. If I simply run the osascript it works, but along with at command it doesn't: osascript -e "display notification \"Warning after a minute\""
Ideas?
I've tried different syntaxes, but they all behave exactly the same, "at" is scheduled but no notification:
at now +1 minute << \eof1
osascript -e 'display notification "Warning after a minute"'
eof1
at now +1 minute << 'END'
osascript << 'END1'
display notification "Warning after a minute"
END1
END
MacBook Pro Retina (2015 and later)