The solution that works for me is doing this command after Calendar starts:
defaults write com.apple.iCal NSDontMakeMainWindowKey YES
Which was kind of a pain since you have to remember to do that after Calendar starts, which I would always forget to do. So I wrote a little launchctl script to do it for me.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd> <plist version="1.0"> <dict>
<key>Label</key>
<string>CalendarSquelch</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>-e</string>
<string>tell application "System Events"
set p to name of processes
if p contains "Calendar" then
do shell script "defaults write com.apple.iCal NSDontMakeMainWindowKey YES"
end if
end tell</string>
</array>
<key>StartInterval</key>
<integer>300</integer> </dict> </plist>
This script checks every 5 minutes to see if Calendar is running. If it is, then it does that little defaults command. Save this file to ~/Library/LaunchAgents/CalendarSquelch.plist
Then run the following command to activate it:
launchctl load ~/Library/LaunchAgents/CalendarSquelch.plist
This was all done on macOS Sierra.