Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSAttributedStringMBS class.

Next items

NSAttributedStringMBS.NSAttachmentAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

NSTextAttachment
Default nil, no attachment

NSAttributedStringMBS.NSAuthorDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.
Example
// get some attributed text:
Var t as new NSAttributedStringMBS
call t.initWithString("Hello World")

// set document attributes
Var dic as new Dictionary
dic.Value(t.NSAuthorDocumentAttribute) = "Test User"

// get rtf
Var rtf as string = t.RTFFromRange(dic)

// write to file
Var f as FolderItem = SpecialFolder.Desktop.Child("test.rtf")
Var b as BinaryStream = BinaryStream.Create(f, true)
b.Write rtf

string containing author name.
Available in Mac OS X v10.4 and later.

Some examples using this method:

NSAttributedStringMBS.NSBackgroundColorAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.
Example
// add background color for text in text area:

TextArea1.Text = "Hello"

Var tv As NSTextViewMBS = TextArea1.NSTextViewMBS
Var ts As NSTextStorageMBS = tv.TextStorage

Var value As Color = &cFF0000

Var offset As Integer = 0
Var length As Integer = 5

Var range As NSRangeMBS = NSMakeRangeMBS( offset, length )
ts.AddAttribute( NSAttributedStringMBS.NSBackgroundColorAttributeName, value, range )

NSColor
Default nil, no background

Some examples using this method:

NSAttributedStringMBS.NSBackgroundColorDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

NSColor, representing the document-wide page background color.
Mac OS X v10.3 and earlier string constant is "BackgroundColor".
For applications linked on versions prior to Mac OS X v10.5, HTML import sets the NSBackgroundColorDocumentAttribute to NSColorMBS.whiteColor in cases in which the HTML does not specify a background color. For applications linked on Mac OS X v10.5 and later, no NSBackgroundColorDocumentAttribute is set in these cases.
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSBaselineOffsetAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

Number containing floating point value, as points offset from baseline
Default 0.0

NSAttributedStringMBS.NSBaseURLDocumentOption as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

For HTML documents; NSURL containing base URL. Previous string constant was @"BaseURL"
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSBottomMarginDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.
Example
// get some attributed text:
Var t as new NSAttributedStringMBS
call t.initWithString("Hello World")

// set document attributes
Var dic as new Dictionary
dic.Value(t.NSBottomMarginDocumentAttribute) = 20
dic.Value(t.NSLeftMarginDocumentAttribute) = 20
dic.Value(t.NSRightMarginDocumentAttribute) = 20
dic.Value(t.NSTopMarginDocumentAttribute) = 20
dic.Value(t.NSAuthorDocumentAttribute) = "Test User"

// get rtf
Var rtf as string = t.RTFFromRange(dic)

// write to file
Var f as FolderItem = SpecialFolder.Desktop.Child("test.rtf")
Var b as BinaryStream = BinaryStream.Create(f, true)
b.Write rtf

Number, containing a float, in points.
Mac OS X v10.3 and earlier string constant is "BottomMargin".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSCategoryDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

string containing the document's category.
Available in Mac OS X v10.6 and later.

NSAttributedStringMBS.NSCharacterEncodingDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Number, containing an int specifying the stringEncoding for the file; for reading and writing plain text files and writing HTML; default for plain text is the default encoding; default for HTML is UTF-8.
Mac OS X v10.3 and earlier string constant is "CharacterEncoding".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSCharacterEncodingDocumentOption as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

For plain text documents; Number containing the unsigned int stringEncoding to override any encoding specified in an HTML document. Previous string constant was @"CharacterEncoding".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSCharacterShapeAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

An integer value. The value is interpreted as Apple Type Services kCharacterShapeType selector + 1.
The default value is 0 (disable). 1 is kTraditionalCharactersSelector, and so on. Refer to <ATS/SFNTLayoutTypes.h> and "Font Features" in ATSUI Programming Guide for additional information.
Available in Mac OS X v10.0 and later.

NSAttributedStringMBS.NSCocoaVersionDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Number, containing a float. For RTF files only, stores the version of Cocoa with which the file was created. Absence of this value indicates RTF file not created by Cocoa or its predecessors.
Values less than 100 are pre–Mac OS X; 100 is Mac OS X v10.0 or v10.1; 102 is Mac OS X v10.2 and 10.3; values greater than 102 correspond to values of NSAppKitVersionNumber on Mac OS X v10.4 and later.
Mac OS X v10.3 and earlier string constant is "CocoaRTFVersion".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSCommentDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

string containing document comments.
Available in Mac OS X v10.4 and later.

Some examples using this method:

NSAttributedStringMBS.NSCompanyDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

string containing company or organization name.
Available in Mac OS X v10.4 and later.

Some examples using this method:

NSAttributedStringMBS.NSConvertedDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Number, containing an int. Indicates whether the file was converted by a filter service.
If missing or 0, the file was originally in the format specified by document type. If negative, the file was originally in the format specified by document type, but the conversion to NSAttributedString may have been lossy. If 1 or more, it was converted to this type by a filter service.
Mac OS X v10.3 and earlier string constant is @"Converted".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSCopyrightDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

string containing document copyright info.
Available in Mac OS X v10.4 and later.

Some examples using this method:

NSAttributedStringMBS.NSCreationTimeDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

NSDate containing the creation date of the document; note that this is not the file system creation date of the file, but of the document.
Available in Mac OS X v10.4 and later.

Some examples using this method:

NSAttributedStringMBS.NSCursorAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

NSCursor
Default as returned by the NSCursor method IBeamCursor
Available in Mac OS X v10.3 and later.

NSAttributedStringMBS.NSDefaultAttributesDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 16.0 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the document attributes.

NSDictionary containing attributes to be applied to plain files. Used by reader methods. This key in options can specify the default attributes applied to the entire document contents. The document attributes can contain this key indicating the actual attributes used.
Available on Mac OS X 10.11.

NSAttributedStringMBS.NSDefaultAttributesDocumentOption as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

For plain text documents; Dictionary containing attributes to be applied to plain files. Previous string constant was @"DefaultAttributes".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSDefaultTabIntervalDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Number containing a float. Represents the document-wide default tab stop interval.
Mac OS X v10.3 and earlier string constant is "DefaultTabInterval".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSDocFormatTextDocumentType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the values for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.

Microsoft Word document.

NSAttributedStringMBS.NSDocumentTypeDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

How the document was interpreted; one of the values in "Document Types."
Mac OS X v10.3 and earlier string constant is "DocumentType".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSDocumentTypeDocumentOption as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

One of the document types described in "Document Types," indicating a document type to be forced when loading the document. Previous string constant was @"DocumentType".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSEditorDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

string containing name of person who last edited the document.
Available in Mac OS X v10.4 and later.

Some examples using this method:

NSAttributedStringMBS.NSExcludedElementsDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString related to HTML generation.

An Array object containing string objects, representing HTML elements not to be used in generated HTML.
Available in Mac OS X v10.4 and later.

NSExcludedElementsDocumentAttribute allows control over the tags used. The recognized values in the NSExcludedElementsDocumentAttribute array are (case-insensitive) HTML tags, plus DOCTYPE (representing a doctype declaration) and XML (representing an XML declaration). By default, if this attribute is not present, the excluded elements will be those deprecated in HTML 4 (APPLET, BASEFONT, CENTER, DIR, FONT, ISINDEX, MENU, S, STRIKE, and U) plus XML. If XML is on the list, HTML forms are used; if XML is not on the list, XHTML forms are used where there is a distinction.

NSAttributedStringMBS.NSExpansionAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

Number containing floating point value, as log of expansion factor to be applied to glyphs
Default 0.0, no expansion
Available in Mac OS X v10.3 and later.

NSAttributedStringMBS.NSFileTypeDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

string indicating which document type was used to interpret the document, specified as a UTI; for reading, this is available along with NSDocumentTypeDocumentAttribute, but for writing the two are mutually exclusive.
Available in Mac OS X v10.6 and later.

NSAttributedStringMBS.NSFileTypeDocumentOption as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

string indicating a document type to be forced when loading the document, specified as a UTI string; mutually exclusive with NSDocumentTypeDocumentOption.
Available in Mac OS X v10.6 and later.

NSAttributedStringMBS.NSFontAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.
Example
MsgBox NSAttributedStringMBS.NSFontAttributeName

Var NSGraphics as New NSGraphicsMBS()
Var NSFont as NSFontMBS = NSFontMBS.fontWithName("Helvetica", 11.0)
Var NSAttributes as New Dictionary

NSAttributes.value(NSAttributedStringMBS.NSFontAttributeName) = nsfont

Var stringWidth as Double = NSGraphics.sizeWithAttributes("Hello World", NSAttributes).Width
MsgBox("StringWidth from NSGraphicsMBS: " + Str(stringWidth))

NSFont
Default Helvetica 12-point

Some examples using this method:

NSAttributedStringMBS.NSForegroundColorAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.
Example
TextArea1.Text = "Hello"

Var tv As NSTextViewMBS = TextArea1.NSTextViewMBS
Var ts As NSTextStorageMBS = tv.TextStorage

Var value As Color = &cFF0000

Var offset As Integer = 0
Var length As Integer = 5

Var range As NSRangeMBS = NSMakeRangeMBS( offset, length )
ts.AddAttribute( NSAttributedStringMBS.NSForegroundColorAttributeName, value, range )

NSColor
Default blackColor
Available in Mac OS X v10.0 and later.

Some examples using this method:

NSAttributedStringMBS.NSGlyphInfoAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

The name of an NSGlyphInfo object.
NSLayoutManager assigns the glyph specified by this glyph info to the entire attribute range, provided that its contents match the specified base string, and that the specified glyph is available in the font specified by NSFontAttributeName.
Available in Mac OS X v10.2 and later.

NSAttributedStringMBS.NSHTMLTextDocumentType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the values for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.

Hypertext Markup Language (HTML) document.

NSAttributedStringMBS.NSHyphenationFactorDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Number, containing a float; 0 = off, 1 = full hyphenation.
Mac OS X v10.3 and earlier string constant is "HyphenationFactor".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSKernAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

Number containing floating point value, as points by which to modify default kerning
Default nil, use default kerning specified in font file; 0.0, kerning off; non-zero, points by which to modify default kerning
Available in Mac OS X v10.0 and later.

NSAttributedStringMBS.NSKeywordsDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Array of string, containing keywords.
Available in Mac OS X v10.4 and later.

Some examples using this method:

NSAttributedStringMBS.NSLeftMarginDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Number, containing a float, in points.
Mac OS X v10.3 and earlier string constant is "LeftMargin".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSLigatureAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

Number containing integer
Default 1, standard ligatures; 0, no ligatures; 2, all ligatures.

NSAttributedStringMBS.NSLinkAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

NSURL (preferred) or string
Default nil, no link
Available in Mac OS X v10.0 and later.

Some examples using this method:

NSAttributedStringMBS.NSMacSimpleTextDocumentType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the values for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.

Macintosh SimpleText document.

NSAttributedStringMBS.NSManagerDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

string containing the name of the author's manager.
Available in Mac OS X v10.6 and later.

NSAttributedStringMBS.NSMarkedClauseSegmentAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

Number containing an integer, as an index in marked text indicating clause segments
Available in Mac OS X v10.5 and later.

NSAttributedStringMBS.NSModificationTimeDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

NSDate containing the modification date of the document contents.
Available in Mac OS X v10.4 and later.

Some examples using this method:

NSAttributedStringMBS.NSObliquenessAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

Number containing floating point value, as skew to be applied to glyphs
Default 0.0, no skew
Available in Mac OS X v10.3 and later.

NSAttributedStringMBS.NSOfficeOpenXMLTextDocumentType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the values for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.

ECMA Office Open XML text document format.
Available in Mac OS X v10.5 and later.

NSAttributedStringMBS.NSOpenDocumentTextDocumentType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the values for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.

OASIS Open Document text document format.
Available in Mac OS X v10.5 and later.

Next items

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...