zenity/internal/osa/scripts/file.gots
2020-01-12 23:16:00 +00:00

25 lines
No EOL
508 B
Text

var app = Application.currentApplication()
app.includeStandardAdditions = true
app.activate()
var opts = {}
opts.withPrompt = {{.Prompt}}
opts.invisibles = {{.Invisibles}}
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()
}