Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
contentPostList.repliesup-voted.tooltip
This is what we are doing:
class EntryPoint: FIFinderSync {
private var windowController: MainWindowConreoller?
override func menu(for menuKind: FIMenuKind) -> NSMenu {
let menu = NSMenu(title: "")
menu.addItem(withTitle: "Example Menu Item", action: #selector(openMainWindow(_:)), keyEquivalent: "")
return menu
}
@objc private func openMainWindow(_ sender: AnyObject?) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { // [1] Switch to main thread !!!
NSApplication.shared.activate(ignoringOtherApps: true) // [2] Activate App !!!
let wc = MainWindowConreoller()
wc.showWindow(nil)
self.windowController = wc // [3] Retain window controller !!!
}
}
}
Working App example:
https://objective-see.com/products/whatsyoursign.html
https://github.com/objective-see/WhatsYourSign/blob/master/WhatsYourSignExt/FinderSync/InfoWindowController.m#L40