zenity/internal/zenutil/osascripts/file.gojs

17 lines
297 B
Text
Raw Normal View History

2022-06-01 19:00:08 -04:00
{{template "common" .}}
2022-05-06 08:48:31 -04:00
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)
}
2020-01-04 22:21:39 -05:00
if (Array.isArray(res)) {
2022-05-06 08:48:31 -04:00
res.join({{json .Separator}})
2020-01-04 22:21:39 -05:00
} else {
2022-05-06 08:48:31 -04:00
res.toString()
2020-01-04 22:21:39 -05:00
}