zenity/internal/zenutil/osascripts/common.gojs
2022-06-02 13:38:41 +01:00

16 lines
No EOL
473 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()