zenity/internal/zenutil/osascripts/common.gojs
2022-06-28 13:57:31 +01:00

18 lines
No EOL
526 B
Text

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