Closed mietzen closed 9 months ago
I tried debugging it, but I don't really get it. When sending ncCenter.add(ncRequest)
the argument is still there so ncRequest._content._userinfo
doesn't know what to do with that argument? But throws no error?
And am I right that this:
func openItem(globalOpenItem: [String]?, verboseMode: Bool) {
if verboseMode {
NSLog("Notifier Log: alert - opening %@", String(describing: globalOpenItem))
}
openItem:
do {
let task = Process()
task.launchPath = "/usr/bin/open"
task.arguments = globalOpenItem
let outputPipe = Pipe()
let errorPipe = Pipe()
task.standardOutput = outputPipe
task.standardError = errorPipe
task.launch()
if verboseMode {
NSLog("Notifier Log: alert - opened %@", String(describing: globalOpenItem))
}
}
}
Is only used pre 10.15 with NSUserNotification?
Sorry this is the first time I touch swift.
I want to do something like that:
./Notifier --type alert --message "My Message" --messagebutton "Open" --messagebuttonaction "/System/Applications/Utilities/Terminal.app ~/test.sh"
Unfortunately everything this doesn't work. It would also be nice to be able to pass option to open, like: