@Russ Sure.
Here is the shell script:
#!/bin/bash
if [ "$1" == "start" ]
then
open -a "Slack"
open -a "Microsoft Outlook"
open -a "Safari"
else
osascript ~/Smarthome/Closeallapps.scpt
pmset sleepnow
fi
And here is the AppleScript for Closeallapps:
tell application "Shortcuts Events"
set theResult to run shortcut "Quit All Applications"
end tell