zenity/internal/osa/scripts/msg.gots

30 lines
599 B
Text
Raw Normal View History

2020-01-04 22:21:39 -05:00
var app = Application.currentApplication()
app.includeStandardAdditions = true
app.activate()
var opts = {}
2020-01-06 07:01:51 -05:00
{{if .Message -}}
opts.message = {{.Message}}
{{end -}}
{{if .As -}}
opts.as = {{.As}}
{{end -}}
{{if .Title -}}
opts.withTitle = {{.Title}}
{{end -}}
{{if .Icon -}}
opts.withIcon = {{.Icon}}
{{end -}}
2020-01-04 22:21:39 -05:00
{{if .Buttons -}}
opts.buttons = {{.Buttons}}
{{end -}}
{{if .Default -}}
opts.defaultButton = {{.Default}}
{{end -}}
{{if .Cancel -}}
opts.cancelButton = {{.Cancel}}
{{end -}}
2020-01-06 19:57:00 -05:00
var res = app[{{.Operation}}]({{.Text}}, opts).buttonReturned
res === {{.Extra}} ? res : void 0