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() }