18 lines
No EOL
526 B
Text
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}} |