@abaratz, you're welcome. I'm glad that worked as a work-around. Thank you for reporting the problem too.
If anyone else experiences this problem, please tell me.
@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