zenity/internal/osa/scripts/file.gots
Nuno Cruces b3dbb1a78a Tweaks.
2020-01-15 01:04:06 +00:00

31 lines
598 B
Plaintext

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