Platforms to show: All Mac Windows Linux Cross-Platform
class NSAttributedStringMBS
class, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: A class to represent a string in the Cocoa world with attached attributes.
Example:
class, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: A class to represent a string in the Cocoa world with attached attributes.
Example:
dim a as new NSAttributedStringMBS
if a.initWithHTML("<B>Hello</B>") then
MsgBox a.htmlString
end if
NSAttributedStringMBS.containsAttachments as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Whether this attributed string has attachments.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Whether this attributed string has attachments.
NSAttributedStringMBS.copy as NSAttributedStringMBS
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates a copy of the attributed string.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates a copy of the attributed string.
NSAttributedStringMBS.docFormatFromRange as string
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates DOC data from the whole string.
Notes:
Same as docFormatFromRange(0,length)
Returns "" on failure.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates DOC data from the whole string.
Notes:
Same as docFormatFromRange(0,length)
Returns "" on failure.
See also:
NSAttributedStringMBS.docFormatFromRange(offset as integer, length as integer) as string
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates DOC data from the current string range.
Notes: Returns "" on failure.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates DOC data from the current string range.
Notes: Returns "" on failure.
See also:
NSAttributedStringMBS.htmlString as string
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.8, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: A self made function to return the text content as html string preserving the style information.
Example:
Does not always work well, but can help.
(Apple has no official function for this)
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.8, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: A self made function to return the text content as html string preserving the style information.
Example:
dim s as NSAttributedStringMBS
s=new NSAttributedStringMBS
if s.initwithhtml("<b>Hello</b>") then
MsgBox s.htmlstring // shows "<b>Hello</b>"
MsgBox s.text // shows "Hello"
end if
Notes: Does not always work well, but can help.
(Apple has no official function for this)
NSAttributedStringMBS.initWithAttributedString(text as NSAttributedStringMBS) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of the given attributed string.
Notes: Returns true on success.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of the given attributed string.
Notes: Returns true on success.
NSAttributedStringMBS.initWithDocFormat(data as string) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given DOC file data.
Notes: Returns true on success.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given DOC file data.
Notes: Returns true on success.
NSAttributedStringMBS.initWithHTML(data as string) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given HTML file data.
Example:
Returns true on success.
With plugin version 9.4 this uses the system function to parse html. The old plugin function is available with the name initWithHTMLOld.
On Mac OS X 10.6 the text encoding expected is ISO Latin 1 as far as I see.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given HTML file data.
Example:
dim n as NSAttributedStringMBS
n=new NSAttributedStringMBS
if n.initWithHTML("<b>test</b>") then
MsgBox n.text
else
MsgBox "failed"
end if
dim attribText as new NSAttributedStringMBS
dim text as string = "<P>Hello öäü</P>"
text = ConvertEncoding(text, encodings.ISOLatin1)
If attribText.initWithHTML(text) Then
MsgBox attribText.text
End If
Notes: Returns true on success.
With plugin version 9.4 this uses the system function to parse html. The old plugin function is available with the name initWithHTMLOld.
On Mac OS X 10.6 the text encoding expected is ISO Latin 1 as far as I see.
See also:
NSAttributedStringMBS.initWithHTML(data as string, BaseURL as string) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes the object with html code from a given url.
Example:
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes the object with html code from a given url.
Example:
dim n as NSAttributedStringMBS
n=new NSAttributedStringMBS
if n.initWithHTML("<b>test</b>","http://www.apple.com") then
MsgBox n.text
else
MsgBox "failed"
end if
Notes: Returns true on success.See also:
NSAttributedStringMBS.initWithHTMLOld(data as string) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given HTML file data.
Notes: With plugin version 9.4 the initWithHTML method uses the system function to parse html. The old plugin function is available with the name initWithHTMLOld.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given HTML file data.
Notes: With plugin version 9.4 the initWithHTML method uses the system function to parse html. The old plugin function is available with the name initWithHTMLOld.
NSAttributedStringMBS.initWithPath(file as folderitem) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of file at the given file.
Notes: Returns true on success.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of file at the given file.
Notes: Returns true on success.
See also:
NSAttributedStringMBS.initWithPath(path as string) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of file at the given path string.
Notes: Returns true on success.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of file at the given path string.
Notes: Returns true on success.
See also:
NSAttributedStringMBS.initWithRTF(data as string) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given RTF file data.
Notes: Returns true on success.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given RTF file data.
Notes: Returns true on success.
NSAttributedStringMBS.initWithRTFD(data as string) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given RTFD file data.
Notes: Returns true on success.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given RTFD file data.
Notes: Returns true on success.
NSAttributedStringMBS.initWithString(text as string) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given plain text.
Example:
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of given plain text.
Example:
dim n as NSAttributedStringMBS
n=new NSAttributedStringMBS
if n.initWithHTML("test") then
MsgBox n.text
else
MsgBox "failed"
end if
Notes: Returns true on success.NSAttributedStringMBS.initWithURL(file as folderitem) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of file at the given file.
Example:
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of file at the given file.
Example:
dim n as NSAttributedStringMBS
n=new NSAttributedStringMBS
if n.initWithURL(SpecialFolder.Desktop.Child("testfile")) then
MsgBox n.text
else
MsgBox "failed"
end if
Notes: Returns true on success.See also:
NSAttributedStringMBS.initWithURL(url as string) as boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of file at the given url.
Notes: Returns true on success.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Initializes string with content of file at the given url.
Notes: Returns true on success.
See also:
NSAttributedStringMBS.isEqualToAttributedString(other as NSAttributedStringMBS) as Boolean
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Compares both strings.
Example:
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Compares both strings.
Example:
dim n as NSAttributedStringMBS
dim m as NSAttributedStringMBS
n=new NSAttributedStringMBS
if n.initWithString("test") then
MsgBox n.text
else
MsgBox "failed"
end if
m=new NSAttributedStringMBS
if m.initWithString("test") then
MsgBox n.text
else
MsgBox "failed"
end if
if m.isEqualToAttributedString(n) then
MsgBox "Ok"
else
MsgBox "failed"
end if
m=new NSAttributedStringMBS
if m.initWithString("test2") then
MsgBox n.text
else
MsgBox "failed"
end if
if m.isEqualToAttributedString(n) then
MsgBox "failed"
else
MsgBox "Ok"
end if
Notes: Returns true if they are equal in content.NSAttributedStringMBS.length as Integer
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Length of text in characters.
Example:
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Length of text in characters.
Example:
dim n as NSAttributedStringMBS
n=new NSAttributedStringMBS
if n.initWithString("test") then
MsgBox str(n.length) // shows 4
else
MsgBox "failed"
end if
NSAttributedStringMBS.mutableCopy as NSMutableAttributedStringMBS
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates a mutable copy of the attributed string.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates a mutable copy of the attributed string.
NSAttributedStringMBS.rtf as string
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Returns the content of this attributed string as a RTF string.
Example:
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Returns the content of this attributed string as a RTF string.
Example:
dim s as NSAttributedStringMBS
s=new NSAttributedStringMBS
if s.initWithString("Hello") then
MsgBox s.RTF
end if
// shows this text:
// {\rtf1\ansi\ansicpg1252\cocoartf949
// {\fonttbl\f0\fswiss\fcharset0 Helvetica;}
// {\colortbl;\red255\green255\blue255;}
// \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
//
// \f0\fs24 \cf0 Hello}
Notes: Same as RTFFromRange(0,length)NSAttributedStringMBS.RTFDFromRange as string
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates RTFD data from the current string range.
Notes:
Returns "" on failure.
Same as RTFDFromRange(0,length)
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 9.4, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates RTFD data from the current string range.
Notes:
Returns "" on failure.
Same as RTFDFromRange(0,length)
See also:
NSAttributedStringMBS.RTFDFromRange(offset as integer, length as integer) as string
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates RTFD data from the current string range.
Notes: Returns "" on failure.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates RTFD data from the current string range.
Notes: Returns "" on failure.
See also:
NSAttributedStringMBS.RTFFromRange as string
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates RTF data from whole string.
Notes:
Returns "" on failure.
Same as RTFFromRange(0,length)
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates RTF data from whole string.
Notes:
Returns "" on failure.
Same as RTFFromRange(0,length)
See also:
NSAttributedStringMBS.RTFFromRange(offset as integer, length as integer) as string
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates RTF data from the current string range.
Notes: Returns "" on failure.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Creates RTF data from the current string range.
Notes: Returns "" on failure.
See also:
NSAttributedStringMBS.text as string
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: The plain text.
method, Cocoa, MBS REALbasic CocoaBase Plugin (NSAttributedString), class NSAttributedStringMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: The plain text.
The items on this page are in the following plugins: MBS REALbasic CocoaBase Plugin.
Links
MBS Realbasic Plugins - Nachhilfe in Plaidt