setup a bash script and call it via a shell command.
look here for apple script and bash scripting examples:
#!/bin/bash
osascript <<EOD
tell application "Google Chrome"
activate
end tell
tell application "System Events"
key down {command}
key down {shift}
keystroke "f"
key up {shift}
key up {command}
end tell
EOD
echo "Google Chrome is now open in Kiosk Mode"
oh, and if you need to call it from a remote machine, call the bash script via ssh from home assistant.