gen2brain / beeep

Go cross-platform library for sending desktop notifications, alerts and beeps
BSD 2-Clause "Simplified" License
1.43k stars 89 forks source link

`title` and `message` not escaped when using AppleScript on macOS #37

Closed ghost closed 2 years ago

ghost commented 4 years ago
func Notify(title, message, appIcon string) error {
...
    cmd := exec.Command(osa, "-e", `display notification "`+message+`" with title "`+title+`"`)
func Alert(title, message, appIcon string) error {
...
    cmd := exec.Command(osa, "-e", `tell application "System Events" to display notification "`+message+`" with title "`+title+`" sound name "default"`)

the code calls the binary osascript, but it fails if title or message contains a double quotation mark

Endermanbugzjfc commented 3 years ago

Agree.

Endermanbugzjfc commented 2 years ago

Finally.

nervo commented 2 years ago

Hm, sorry, but as far as i can see, notify is fixed by https://github.com/gen2brain/beeep/commit/d7852edf42fcad580965acb60e07a3b468409d4a, but not alert :) Am i wrong ?