Use json to quote strings.
This commit is contained in:
parent
17827d3b70
commit
e34f649c02
2 changed files with 12 additions and 10 deletions
|
@ -55,13 +55,13 @@ fmt.stringFromDate(date.dateValue)
|
|||
var app=Application.currentApplication()
|
||||
app.includeStandardAdditions=true
|
||||
app.activate()
|
||||
ObjC.import("stdlib")
|
||||
ObjC.import("stdio")
|
||||
var opt={{json .Options}}
|
||||
ObjC.import('stdio')
|
||||
ObjC.import('stdlib')
|
||||
var opts={{json .Options}}
|
||||
{{- if .IconPath}}
|
||||
opt["withIcon"]=Path("{{.IconPath}}")
|
||||
opts.withIcon=Path({{json .IconPath}})
|
||||
{{- end}}
|
||||
var res=app.{{.Operation}}({{json .Text}},opt)
|
||||
var res=app.{{.Operation}}({{json .Text}},opts)
|
||||
if(res.gaveUp){$.exit(5)}
|
||||
if(res.buttonReturned==={{json .Extra}}){$.puts(res.buttonReturned)
|
||||
$.exit(1)}
|
||||
|
|
|
@ -2,13 +2,15 @@ var app = Application.currentApplication()
|
|||
app.includeStandardAdditions = true
|
||||
app.activate()
|
||||
|
||||
ObjC.import("stdlib")
|
||||
ObjC.import("stdio")
|
||||
var opt = {{json .Options}}
|
||||
ObjC.import('stdio')
|
||||
ObjC.import('stdlib')
|
||||
|
||||
var opts = {{json .Options}}
|
||||
{{- if .IconPath}}
|
||||
opt["withIcon"] = Path("{{.IconPath}}")
|
||||
opts.withIcon = Path({{json .IconPath}})
|
||||
{{- end}}
|
||||
var res = app.{{.Operation}}({{json .Text}}, opt)
|
||||
|
||||
var res = app.{{.Operation}}({{json .Text}}, opts)
|
||||
if (res.gaveUp) {
|
||||
$.exit(5)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue