Swift NSWorkspace Open Link with Finder, Hide Finder Window

236 Views Asked by At

With NSWorkspace one can open an URL in Finder. If it is a network drive, it will also mount the Link in Volumes

How can one open the URL in Finder without actually popping up a Finder Window in foreground?

The code below does not hide the popup

let validUrl = URL(string: "smb://server/folder")
let configuration = NSWorkspace.OpenConfiguration()
configuration.hides = true // seems to do nothing...
NSWorkspace.shared.open(validUrl, configuration: configuration) { _, error in
    // Finder Window in Popup occurs
}
0

There are 0 best solutions below