我明白了
package mainimport ( "fmt" "exec")func main() { command := "Tell Application "iTunes" to playpause" c := exec.Command("/usr/bin/osascript", "-e", command) if err := c.Run(); err != nil { fmt.Println(err.String()) }}我认为exec.Command(…)如果参数中有空格,则在参数中添加双引号,因此您只需要在需要它们的位置转义“。



