简体   繁体   中英

Mac OSx: Injecting item to Finder's Context Menu

In 10.5, we have native support for context menu plugins. This allows us to add items on runtime, and adding different menus for different file types.

But since 10.6 and higher, we have context menu services which don't allow subMenus, and don't help if we wanted to add different items in context menu on runtime based on file type of location.

This has lead me to do some code injection into Finder(like DropBox has done), but I'm kind of new to this particular task, but I'm willing to do it. Does any one can give me a starting point.

Thanks in anticipation.

You can start with mach_star . mach_star is an open-source code suite for suppressing, replacing and/or extending Mac OS X functionality at a very low level. Its principal components are mach_override (replace and/or extend existing functions at runtime) and mach_inject (dynamically load your code into a running process).

Up to to the OS X 10.9.x only injecting code to Finder process via mach_inject was a solution (and even Dropbox did that). However since 10.10 there are Finder plugins, which can customize context menus, add buttons to Toolbar and put overlays over the file icons.

Update: since OS X 10.11 code injection will not work at all due to System Integrity Protection. So only Finder Sync plugin.

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