How can I make the dock Downloads stack bounce programmatically? I don't want to bounce my app's icon.
I found this Solution for Objective-C on the Web:
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"com.apple.DownloadFileFinished" object:pathToFile];
And changed them to a Swift-Pedant, but this doesn't work:
let defaultCenter = DistributedNotificationCenter ()
defaultCenter.postNotificationName(NSNotification.Name(rawValue: "com.apple.DownloadFileFinished"), object: file.absoluteString, userInfo: nil, deliverImmediately: true)
I'm using Swift 5 for a Mac App and macOS Mojave 10.14.6.
In particular, I'm downloading a file from my app to Downloads folder. No problem with this, but I want the Downloads icon to bounce when the download is finished (as happen when Safari completes a download).