zenity/internal/zenutil/osascripts/common.gojs

18 lines
526 B
Text
Raw Normal View History

2022-06-02 07:49:31 -04:00
{{- if .Application}}
2022-06-27 11:56:24 -04:00
try {
var app = Application({{json .Application}})
} catch {
var app = Application.currentApplication()
}
2022-06-02 07:49:31 -04:00
{{- else}}
2022-06-01 19:00:08 -04:00
var app = Application.currentApplication()
2022-06-02 07:49:31 -04:00
{{- end}}
2022-06-27 11:56:24 -04:00
app.includeStandardAdditions = true
2022-06-01 19:00:08 -04:00
2022-06-08 18:52:44 -04:00
{{if .WindowIcon}}{
2022-06-02 07:49:31 -04:00
ObjC.import('Cocoa')
let nsapp = $.NSApplication.sharedApplication
let nsimg = $.NSImage.alloc.initWithContentsOfFile({{json .WindowIcon}})
nsapp.setActivationPolicy($.NSApplicationActivationPolicyRegular)
nsapp.setApplicationIconImage(nsimg)
2022-06-27 11:56:24 -04:00
}{{end}}