简体   繁体   中英

How to add Finder/Services menu items to own macOS contextual menu

When a file is right-clicked in the macOS Finder, a contextual menu like this shows up. It contains items at the bottom from macOS Services. I'm talking about services from third party such as (in this case) iTerm and Find Any File. How would I go about adding such items to a contextual menu in my own macOS app? Is there a documented API to do this?

Finder上下文菜单

I know this can be done, because it's implemented in at least one other application, see for example the following contextual menu in Find Any File:

查找任何文件上下文菜单

macOS provides App Extensions for products to integrate with the OS. The programming guide lists the different extension points that can be utilised, along with a description of their purpose.

Based on the example you've provided, it may be the Finder Sync extension that you're looking for, as the documentation states for Finder Sync:

Badge local OS X folders to let users know the status of items that are remotely synced. You can also implement contextual menus to let users directly manage their synced content.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM