flymg
flymg

Reputation: 637

Swift NSWorkspace Open Link with Finder, Hide Finder Window

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
}

Upvotes: 2

Views: 279

Answers (0)

Related Questions