Dynamic Services menu, CM plug-in alternatives
Dynamic Services menu, CM plug-in alternatives
- Subject: Dynamic Services menu, CM plug-in alternatives
- From: Dragan Milić <email@hidden>
- Date: Wed, 01 Jul 2009 00:29:11 +0200
Hello everyone,
I'd firstly like just to mention that I'm not a premium ADC member and
I've had the bare bones Snow Leopard 10A380 build (passed as a asset
from a fellow developer, who is a premium member), without any new
developer tools or documentation,... So I don't have full insight in
all the news and changes in APIs and frameworks. What I do know is
that the new Cocoa Finder doesn't even try to load my contextual menu
plug-in, regardless of the architecture its binary contains (32-bit,
64-bit).
According to this: http://lists.apple.com/archives/Carbon-dev/2009/Apr/msg00074.html
thread, "There is currently no way to extend contextual menus in 64-
bit apps. Snow Leopard includes some significant enhancements to the
Services architecture that are designed to partially replace the
capabilities of contextual menus." and "As far as I know, it was made
for exactly the reason I specified - the Cocoa team really doesn't
want to load arbitrary code into every Cocoa process because of the
risk of malware being loaded. Please take me at my word." says Eric
Schlegel from Apple (sorry for citing you Eric, I hope you don't mind
it). So, 3rd party Finder CM plug-ins seem to definitely be dead soon
and Apple is making it hard again for the small developers who already
have such applications developed and are expected to update them for
the coming OS release.
As it seems at the moment, the only alternative is Service
architecture. I also noticed that some Services I set up in Snow
Leopard also appear (if applicable) in the Finder contextual menu.
Nice, I've got nothing against that, finally I'll be able to move all
my code to Cocoa and forget hard-to-swallow CM architecture. There is
only one problem though; CM plug-in allows for full dynamism of the
menu, while Service architecture doesn't.
For example, I provide CM plug-in which can perform a lot of archiving/
compressing/extracting/decompressing tasks on selected files. The menu
is usually populated with some static items, which always appear (as
implemented in the Services architecture). But I want to display
"Extract" menu item only if at least one of selected files in an
archive file. With CM plug-in I can easily examine files in the
CMPlugInExamineContext() function call, and depending on their nature
provide he "Extract" menu item, or not. But it is not possible with
Services. All menu items are firmly defined in application's
Info.plist file. Changing that file dynamically is out of question,
since it'd require write access to the application install location
and calling NSUpdateDynamicServices() and even if it was feasible, it
wouldn't help, since it'd be already too late, the menu needs be
modified just before being shown, so the services are already
advertised.
This long story is just an intro to my real question: will "some
significant enhancements to the Services architecture that are
designed to partially replace the capabilities of contextual menus"
allow for dynamic modification of the Services menu?
If yes, which tool I can use and where to get any documentation to
start playing with it so my CM plug-in is ready as a reborn service at
the time Snow Leopard is released?
If not, what would really be the path to go to implement Finder
contextual menu which would be possible to modify on the fly,
depending on the current context/selection before showing it to the
user? Input Manager? Do I really need to take that direction?
Milke
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden