Another way to schedule waking up from sleep is to use pmset:
sudo pmset repeat wakeorpoweron MTWRFSU 03:45:00
launchd cannot wake a computer from sleep, but it does run jobs scheduled during sleep after waking up. If others search for how to do that, you can for example save this plist as ~/Library/LaunchAgents/some.label.plist
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>some.label</string>
<key>ProgramArguments</key>
<array>
<string>say</string>
<string>a</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>23</integer>
<key>Minute</key>
<integer>59</integer>
</dict>
</dict>
</plist>
Then run launchctl load ~/Library/LaunchAgents/some.label.plist
.