Re: Services Menu in Snow Leopard
Re: Services Menu in Snow Leopard
- Subject: Re: Services Menu in Snow Leopard
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sun, 6 Sep 2009 09:47:01 +0700
On 5 Sep 2009, at 17:08, Jean-Daniel Dupas wrote:
Le 5 sept. 2009 à 06:26, Gerriet M. Denkmann a écrit :
I have an app which provides info about files, folders, symlinks,
etc.
In Leopard the Services Menu of e.g. Finder did show my "Get
Information" regardless whether a file or a folder was selected.
In Snow Leopard the Services Menu of Finder is empty whenever a
folder is selected (files and other stuff work ok).
(To be exact: aliases or symlinks to folders also result in an
empty Services Menu)
System Preferences → Keyboard → Keyboard Shortcuts correctly
contains my "Get Information" under the "Text" heading, but NOT
under "Files and Folders".
But, as I said, it IS working for files - only folders don't work.
My Info.plist has: Send Types = NSFilenamesPboardType +
NSStringPboardType
What am I doing wrong?
Kind regards,
Gerriet.
P.S. I have just re-read the "Services Implementation Guide" but
found no clue to my problem.
No, the answer is not in the guide AFAIK.
Add the key NSRequiredContext and in this dictionary, add a
NSServiceCategory key with value public.item.
<key>NSRequiredContext</key>
<dict>
<key>NSServiceCategory</key>
<string>public.item</string>
</dict>
This did not help. But thanks anyway.
It turns out that the Finder in Columns View does not like folders,
symlinks to folders or aliases to folders (List, Icon and Cover Flow
work just fine).
Maybe this different behaviour is a feature. Clearly looks odd and
inconsistent.
A lesson (learned the hard way) how to debug Services:
0. build new version of app (changing the menu title of your service
might be a good idea)
1. put app into (subdirectory) of Applications
2. do /System/Library/CoreServices/pbs
3. check for your CFBundleIdentifier in the result of /System/Library/
CoreServices/pbs -dump_pboard
4. do /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder -
NSDebugServices < your CFBundleIdentifier>
If we have in our Info.plist:
NSRequiredContext
NSTextContent = FilePath
then a selected text must contain an absolute file path preceeded by
white space(including \n) (or start of file) otherwise our service
will not be offered in the Services Menu.
I really think that only the selected characters should be considered.
E.g. with a text like:
Please look at: "/etc" to find ...
if only the characters inside the "" are selected, it should still be
considered as a FilePath.
You can test this by looking for the service "Open Selected File in
TextEdit".
Looks like a bug to me, but who knows.
Kind regards,
Gerriet.
_______________________________________________
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