• 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
Apple Sample Code not working? SampleCMPlugin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Apple Sample Code not working? SampleCMPlugin


  • Subject: Apple Sample Code not working? SampleCMPlugin
  • From: Steve Cronin <email@hidden>
  • Date: Thu, 21 May 2009 03:23:48 -0500

Folks;

I'm making slow progress on what seems like should be a really simple contextual menu plugin.

Build the 2006 version of Apple's SampleCMPlugin (that's the latest I could find)

There is a section of code to determine if the current selection is text (or could be coerced to text):
...
static OSStatus WhoPastePluginExamineContext(void* thisInstance, const AEDesc* inContext, AEDescList* outCommandPairs ) {
...
if ( inContext ) {
AEDesc theAEDesc = { typeNull, NULL };
...
if ( AECoerceDesc( inContext, typeUTF8Text, &theAEDesc ) == noErr ) {
...


Earlier versions of SampleCMPlugin used '(AECoerceDesc( inContext, typeChar, &theAEDesc )'

No matter what text I select this ALWAYS fails. The plugin NEVER detects text correctly.
I have set up a generic coerce method and tested for both of these as well as:
typeUnicodeText, typeStyledText, typeIntlText, typeCFStringRef (They all fail!)


I admit I'm on thin ice with the AECoerceDesc but it just seems like it shouldn't be this hard?
I'm using unmodified Apple sample code.... XC3.1.2 on 10.5.7 Intel (10.5 SDK deploy 10.4)


Can someone clarify how I can correctly determine whether there is text AND then how to actually obtain the text.
(No Cocoa allowed as this is a .c file!)


Thanks for any help!
Steve


_______________________________________________

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


  • Follow-Ups:
    • Re: Apple Sample Code not working? SampleCMPlugin
      • From: Eric Schlegel <email@hidden>
  • Prev by Date: How to set dpi of an image
  • Next by Date: Re: How to set dpi of an image
  • Previous by thread: Re: How to set dpi of an image
  • Next by thread: Re: Apple Sample Code not working? SampleCMPlugin
  • Index(es):
    • Date
    • Thread