Streamline JXA.
This commit is contained in:
parent
79197f2d9e
commit
efd706d1d3
3 changed files with 4 additions and 4 deletions
|
@ -21,14 +21,14 @@ var res=app.chooseColor({defaultColor:{{json .}}})
|
|||
var app=Application.currentApplication()
|
||||
app.includeStandardAdditions=true
|
||||
app.activate()
|
||||
var res=app[{{json .Operation}}]({{json .Options}})
|
||||
var res=app.{{.Operation}}({{json .Options}})
|
||||
if(Array.isArray(res)){res.join({{json .Separator}})}else{res.toString()}
|
||||
{{- end}}
|
||||
{{define "msg" -}}
|
||||
var app=Application.currentApplication()
|
||||
app.includeStandardAdditions=true
|
||||
app.activate()
|
||||
var res=app[{{json .Operation}}]({{json .Text}},{{json .Options}})
|
||||
var res=app.{{.Operation}}({{json .Text}},{{json .Options}})
|
||||
if(res.gaveUp){ObjC.import("stdlib")
|
||||
$.exit(5)}
|
||||
if(res.buttonReturned==={{json .Extra}}){res.buttonReturned}else{void 0}
|
||||
|
|
|
@ -2,7 +2,7 @@ var app = Application.currentApplication()
|
|||
app.includeStandardAdditions = true
|
||||
app.activate()
|
||||
|
||||
var res = app[{{json .Operation}}]({{json .Options}})
|
||||
var res = app.{{.Operation}}({{json .Options}})
|
||||
if (Array.isArray(res)) {
|
||||
res.join({{json .Separator}})
|
||||
} else {
|
||||
|
|
|
@ -2,7 +2,7 @@ var app = Application.currentApplication()
|
|||
app.includeStandardAdditions = true
|
||||
app.activate()
|
||||
|
||||
var res = app[{{json .Operation}}]({{json .Text}}, {{json .Options}})
|
||||
var res = app.{{.Operation}}({{json .Text}}, {{json .Options}})
|
||||
if (res.gaveUp) {
|
||||
ObjC.import("stdlib")
|
||||
$.exit(5)
|
||||
|
|
Loading…
Reference in a new issue