Search code examples
macosmethodsfinder

Contextual Menu item method swizzling


Any idea how do I handle contextual menu click inside finder via method swizzling ? I am trying to find which method needs to be overridden from Finder.h for this?


Solution

  • I found this sample which shows how to add the items using method swizzling and code injection.

    https://github.com/infinitelabs/FinderMenu

    Adds submenu to the context menu of Mac OS X Finder. Submenu has two items, clicking on them the window with the selected items is displayed.

    It uses https://github.com/rentzsch/mach_inject to update the Finder process. Seems like it should do what you want.