zenity/internal/osa/scripts/msg.gots
2020-01-07 00:57:50 +00:00

30 lines
599 B
Plaintext

var app = Application.currentApplication()
app.includeStandardAdditions = true
app.activate()
var opts = {}
{{if .Message -}}
opts.message = {{.Message}}
{{end -}}
{{if .As -}}
opts.as = {{.As}}
{{end -}}
{{if .Title -}}
opts.withTitle = {{.Title}}
{{end -}}
{{if .Icon -}}
opts.withIcon = {{.Icon}}
{{end -}}
{{if .Buttons -}}
opts.buttons = {{.Buttons}}
{{end -}}
{{if .Default -}}
opts.defaultButton = {{.Default}}
{{end -}}
{{if .Cancel -}}
opts.cancelButton = {{.Cancel}}
{{end -}}
var res = app[{{.Operation}}]({{.Text}}, opts).buttonReturned
res === {{.Extra}} ? res : void 0