• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSServices - Validation bug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSServices - Validation bug


  • Subject: Re: NSServices - Validation bug
  • From: Jim Correia <email@hidden>
  • Date: Fri, 12 Mar 2010 01:32:47 -0500

On Mar 8, 2010, at 5:02 AM, email@hidden wrote:

> I have some queries regarding Services menu validation . I would like to enable different services provided by my app based on whether a file or folder is selected in the Finder. I have set NSFilenamesPboardType  as the send type for the services.I have gone through the

>
> - (id) validRequestorForSendType:(NSString*)sendType returnType:(NSString *)returnType
>
> method but my issue is that the validation there seems to be done based on the sendType and return type. In my case , the selected file and folder pasteboard type is the same and I cannot determine whether the selected item in the Finder is a file or folder during the validation process(This is before the actual service gets invoked i.e when the services menu is being shown to the user )?

>
> So my question is that is there any way I can get some info about the selected item in the Finder and validate the different service menus offered by my application based on some info regarding the item rather than the basic validation of the send and return types ?

You can only validate by the type in your service validation method, not the contents of the pasteboard.

You can switch to using more specific UTIs for our service (if you only, for example, want to accept a file, folder, or package). You can also use NSRequiredContext in your service specification to restrict service availability based on pasteboard content.

- Jim_______________________________________________

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

References: 
 >NSServices - Validation bug (From: email@hidden)

  • Prev by Date: Re: Core Data: inverse relationship not updated until next Run Loop
  • Next by Date: Re: Switching methods in private classes in Apple frameworks
  • Previous by thread: NSServices - Validation bug
  • Next by thread: Creating NSOutlineView programmatically
  • Index(es):
    • Date
    • Thread