zenity/internal/zenutil/osascripts/common.gojs
2022-12-06 18:24:37 +00:00

19 lines
No EOL
541 B
Text

{{if .WindowIcon}}{
ObjC.import('Cocoa')
let nsapp = $.NSApplication.sharedApplication
let nsimg = $.NSImage.alloc.initWithContentsOfFile({{json .WindowIcon}})
nsapp.setActivationPolicy($.NSApplicationActivationPolicyRegular)
nsapp.setApplicationIconImage(nsimg)
}{{end}}
{{- if .Application}}
try {
var app = Application({{json .Application}})
} catch {
var app = Application.currentApplication()
}
{{- else}}
var app = Application.currentApplication()
{{- end}}
app.includeStandardAdditions = true
app.activate()