I wrote a command that sends a text, but it's not working, even though if I paste the command in it does. Is there some syntax error or thing i'm missing?
The printed command is:
/usr/bin/osascript -e 'tell application "Messages"' -e 'set mybuddy to a reference to text chat id "iMessage;+;chatXXXXXXXXXX"' -e 'send "test" to mybuddy' -e 'end tell'
my code is:
command := fmt.Sprintf("/usr/bin/osascript -e 'tell application \"Messages\"' -e 'set mybuddy to a reference to text chat id \"%s\"' -e 'send \"%s\" to mybuddy' -e 'end tell'", chatid, message)
fmt.Println(command)
exec.Command(command).Run()