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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to