Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to pass rich text to cocoa or is Mail.app "content" is not text?



Dear List.

I tried to pass the content of a Mail.app message to an Objective-C (class-) method. If you look at the dictionary, then "the content" is described as "text" and "text" in AppleScript means rich text (w/ attachments) rather than "string". If you look into the developer documentation, then AppleScript's text corresponds to NSText.

However, if I try pass "the content of message myMessage" to Cocoa via a
call method "processText:" of class "textHelper" with parameter theContent
I receive the text as NSCFString on the cocoa side, so ALL rich text formatting information is lost!

BTW: The style info is also lost if you do
set theContent to the content of message theMeassageA as text
set the content of messageB to theContent
but if you do
set the content of messageB to the content of message theMeassageA

I thought that "text" is "rich text", ie. "text" is NSText. What is wrong here and how can I extract the rich text of a Mail.app message and pass it to cocoa or to another message?

(Of course, the motivation for this is the very slow string processing in AppleScript, which I would like to avoid - see my other post).

Thank you.

Christian

____________________________________
Christian Fries
Web: http://www.christian-fries.de
Email: email@hidden
Public Key: http://www.christian-fries.de/publickey
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.