MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to save RTFD?
Feedback.

Answer: With NSTextViewMBS you can use this code to save to RTFD:
Example:
// save text as RTFD including image attachments
dim f as FolderItem = GetSaveFolderItem(FileTypes1.ApplicationRtfd, "test.rtfd")

if f = nil then Return

dim a as NSAttributedStringMBS = textView.textStorage
dim w as NSFileWrapperMBS = a.RTFDFileWrapperFromRange(0, a.length, DocumentAttributes)

dim e as NSErrorMBS
if w.writeToFile(f, e) then

else
MsgBox e.LocalizedDescription
end if
Notes: For TextArea you can query the underlaying NSTextViewMBS object via TextArea.NSTextViewMBS method.




Links
MBS Real Studio Plugins