I am writing a bash script that utilizes AppleScript that disables the microphone and camera, and then clicks the "Join now" button on the google meet webpage. The portion that disables the microphone and camera works perfectly, but I am running into issues with the part of the script that is meant to click the join button. Here is the script:
#!/bin/bash
osascript <<EOF
tell application "System Events"
delay 4
key code 14 using command down
delay 1
key code 2 using command down
delay 1
end tell
EOF
#the following is not working-
osascript <<EOF
tell application "brave"
tell active tab of window 1 to -
execute JavaScript "document.getElementById('Join now')[0].click();"
end tell
EOF
When the second part of the script tries to execute, I get this error:
62:63: syntax error: Expected expression but found end of line. (-2741)
How do I fix this error and get the script to execute properly (click the button)?