>> There is a nice (Carbon only) example on how to edit and run an AppleScript 
>> from Xojo.
>> When building for Cocoa it won’t do the formating, as .SetTextAndStyle is 
>> not available.
> 
> You would need to use NSAppleScriptMBS.richTextSource which is the future.


I’m stuck.  How can I get a richtext to be displayed as formatted in a textarea 
(in Cocoa)?

I found the MBS example, but I can’t figure out how to display this in a 
textarea, instead of writing it out to a file:

Any hint?

Oliver

==
// init with some source
dim source as string = "tell Application ""iTunes"" to play"
dim n as new NSAppleScriptMBS(source)

// compile
call n.compile

// format text
dim richtext as NSAttributedStringMBS = n.richTextSource

if richtext = nil then
  MsgBox "Failed to format source."
else
  // write to RTF file
  dim file as FolderItem = SpecialFolder.Desktop.Child("test.rtf")
  dim b as BinaryStream = file.CreateBinaryFile("")
  
  b.Write richtext.RTF
  b.close
  
  file.Launch
end if
==

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to