2020-01-21 07:03:58 -05:00
|
|
|
var app = Application.currentApplication()
|
|
|
|
app.includeStandardAdditions = true
|
|
|
|
app.activate()
|
|
|
|
|
2021-02-19 12:46:47 -05:00
|
|
|
var res = app[{{json .Operation}}]({{json .Text}}, {{json .Options}})
|
2020-01-28 07:46:43 -05:00
|
|
|
if (res.gaveUp) {
|
|
|
|
ObjC.import("stdlib")
|
|
|
|
$.exit(5)
|
|
|
|
}
|
|
|
|
if (res.buttonReturned === {{json .Extra}}) {
|
|
|
|
res
|
|
|
|
} else {
|
|
|
|
void 0
|
|
|
|
}
|