zenity/internal/osa/scripts/file.gots
2020-01-09 02:38:10 +00:00

24 lines
474 B
Plaintext

var app = Application.currentApplication()
app.includeStandardAdditions = true
app.activate()
var opts = {}
opts.withPrompt = {{.Prompt}}
opts.multipleSelectionsAllowed = {{.Multiple}}
{{if .Type -}}
opts.ofType = {{.Type}}
{{end -}}
{{if .Name -}}
opts.defaultName = {{.Name}}
{{end -}}
{{if .Location -}}
opts.defaultLocation = {{.Location}}
{{end -}}
var res = app[{{.Operation}}](opts)
if (Array.isArray(res)) {
res.join({{.Separator}})
} else {
res.toString()
}