Is there away to shutdown Mac or restart Mac ? If so , how/
put your cursor to the top of the screen, then press the apple icon and press restart or shutdown.
Use AppleScript as in image above.
tell application "Finder"
restart
end tell
I use this to reboot a Mac remotely from a streamdeck via web server.