zenity/internal/osa/scripts/file.gots
2020-01-06 12:06:03 +00:00

24 lines
No EOL
496 B
Text

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(String.fromCodePoint({{.Separator}}))
} else {
res.toString()
}