I am developing a FinderSync
extension and I have some issues in checking if the selection is selecting, or selecting/deselecting the extension.
Is there a way to programmatically check if a FinderSync
extension is selected in System Preferences->Extensions
?
Are there any API's to get notified when this selection changes?
Is there any API to select/deselect an extension, beside using the following?
system("pluginkit -e use -i com.mycompany.finderExt")
Note that I have already visited these pages:
How to enable FinderSync Extension in the System Preference in Cocoa - Objective C
OSX Finder Sync Extension
pluginkit -m -A -i com.mycompany.finderExt
If the extension is enabled, the call will return
"+ com.mycompany.finderExt(1)"
If the extension is not enabled, the call will return
"- com.mycompany.finderExt(1)"
Notice the plus and minus signs, just parse the return to determine if the extension is enabled.
macOS 10.14 Mojave adds two useful new methods for Extension management:
The application hosting a Finder Sync Extension can determine whether the user has enabled the extension, and can show the UI for managing extensions. When the application becomes active again, it can check whether the user has enabled the extension.
@available(OSX 10.14, *)
open class var isExtensionEnabled: Bool { get }
@available(OSX 10.14, *)
open class func showExtensionManagementInterface()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With