To add entries to the Nautilus context menus you can use one of the menu pragmas that are defined in the AbstractNautilusUI
menu pragmas
protocol.
Just define a class side method with one of the pragmas on any class you desire. For example:
MyClass class >> myMenuEntry: aBuilder
<nautilusGlobalPackageMenu>
| target packages |
target := aBuilder model.
(packages := target selectedPackages) ifNil: [ ^ target ].
(aBuilder item: #'Show my selection')
action: [ self inform: packages ]
In the case of the Nautilus package menu you obtain the selection via
aBuilder model selectedPackages
Use the Finder’s pragma search option to look at examples.
(Thanks to Benjamin Van Ryseghem)