J'ai écrit une commande qui envoie un texte, mais cela ne fonctionne pas, même si je colle la commande à l'intérieur. Y a-t-il une erreur de syntaxe ou une chose qui me manque?golang exec osascript ne pas appeler
La commande imprimée est: /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'
mon code est:
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()