[Pyobjc-dev] problem saving as rtfd
Brought to you by:
ronaldoussoren
From: chris <por...@ya...> - 2003-05-12 03:46:37
|
Hello all, First of all I'd like to thank you for such a great tool. Now on to my problem I'm having a problem saving a file as rtfd. everything goes fine but when I open the result in TextEdit it is unformatted, the formatting information being clearly visible as if it where part of the text. Does anyone know what's going on here? Thank you in advance. Chris file infomation set in targets: Name: rtfd Role: Editor OS Type: rtfd extensions: rtfd signature: rtfd the saving function: def dataRepresentationOfType_(self, aType): # return an NSData containing the document's data represented as # the type identified by aType. passphrase = self.keyString.string() cypherChoise = self.cypherOptions.titleOfSelectedItem() plaintext = "" cyphertext = NSData.alloc() #if the plaintext was manually encrypted then it needs no further encryption #in fact further encryption could be harmful if self.encrypted == NO and self.saveSwitch.state() == 1: #edited out as this code isn't running #at this time. else: length = len(self.text.string()) cyphertext.initWithBytes_length(self.text.RTFDFromRange_((0,length)),length) #output the cyphertext to a file return cyphertext sample output for bold "hello world" copied from TextEdit: rtfd __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |