objective-cmacossystem-preferencesfindersync

FinderSync check if extension is selected


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


Solution

  • 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.