On 2014 Dec 19, at 17:00, Jens Alfke wrote:
On Dec 19, 2014, at 1:39 PM, Charles Jenkins <cejw...@gmail.com> wrote: But when it comes time to save to a file format selected from AppKit additions (e.g. RTFFromRange:documentAttributes:), any unusual, application-specific attributes will be lost. There is no built-in file format you can select that will save just any arbitrarily named attribute.

Am I right?

Yes, as far as I know. How would AppKit store your arbitrary attributes into an HTML document? It would have to be a nasty hack like adding a magic HTML attribute (like "nsattributedstringmetadata") whose value was a base64 string of an NSArchive of the attribute dictionary. O_o

Except that the last time I looked, the MSFT RTF pseudo-standard allowed any tag compatible with the scheme (slash whatever). And if you're importing the file and don't recognize it, you're supposed to just drop it and move on (which can have some interesting results when you're nested in several attributes, but...). Whatever attribute is in the attributed text in memory should cause generation of a tag with that name.

So, then the problem becomes, how do you get it to pass on those custom tags as custom attributes, or to your custom attribute processor?

_______________________________________________

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

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

Reply via email to