zenity/internal/zenutil/osascripts/common.gojs
2022-06-09 00:31:14 +01:00

16 lines
No EOL
469 B
Text

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