zenity/internal/zenutil/osascripts/file.gojs
2022-05-09 15:50:25 +01:00

20 lines
No EOL
368 B
Text

var app = Application.currentApplication()
app.includeStandardAdditions = true
app.activate()
ObjC.import('stdio')
ObjC.import('stdlib')
try {
var res = app.{{.Operation}}({{json .Options}})
} catch (e) {
if (e.errorNumber === -128) $.exit(1)
$.dprintf(2, e)
$.exit(-1)
}
if (Array.isArray(res)) {
res.join({{json .Separator}})
} else {
res.toString()
}