Platforms to show: All Mac Windows Linux Cross-Platform
NSAttributedStringMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Example:
dim a as new NSAttributedStringMBS
if a.initWithHTML("<B>Hello</B>") then
MsgBox a.htmlString
end if
- 5 properties
- property containsAttachments as boolean
- property Handle as Integer
- property length as Integer
- property Range as NSRangeMBS
- property text as string
- 57 methods
- method AsCFAttributedString as Variant
- method attributeAtIndex(name as string, location as UInt64) as Variant
- method attributeAtIndex(name as string, location as UInt64, inRange as NSRangeMBS) as Variant
- method attributeAtIndex2(name as string, location as UInt64, byref effectiveRange as NSRangeMBS) as Variant
- method attributeAtIndex2(name as string, location as UInt64, byref longestEffectiveRange as NSRangeMBS, inRange as NSRangeMBS) as Variant
- method attributedSubstringFromRange(range as NSRangeMBS) as NSAttributedStringMBS
- method attributesAtIndex(location as UInt64) as dictionary
- method attributesAtIndex(location as UInt64, inRange as NSRangeMBS) as dictionary
- method attributesAtIndex2(location as UInt64, byref range as NSRangeMBS) as dictionary
- method attributesAtIndex2(location as UInt64, byref range as NSRangeMBS, inRange as NSRangeMBS) as dictionary
- method Constructor
- method Convert_Operator as string
- method copy as NSAttributedStringMBS
- method CopyToClipboard as Boolean
- method dataFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil, byref error as NSErrorMBS) as memoryblock
- method docFormatFromRange(documentAttributes as dictionary = nil) as MemoryBlock
- method docFormatFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil) as MemoryBlock
- method fileWrapperFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil, byref Error as NSErrorMBS) as NSFileWrapperMBS
- method GeneratePDF(PrintOptions as Variant = nil) as MemoryBlock
- method htmlString as string
- method initWithAttributedString(text as NSAttributedStringMBS) as boolean
- method initWithDocFormat(data as MemoryBlock) as boolean
- method initWithDocFormat(data as memoryblock, byref documentAttributes as dictionary) as boolean
- method initWithHTML(data as MemoryBlock) as boolean
- method initWithHTML(data as MemoryBlock, BaseURL as string) as boolean
- method initWithHTML(data as memoryblock, BaseURL as string, byref documentAttributes as dictionary) as boolean
- method initWithHTML(data as memoryblock, byref documentAttributes as dictionary) as boolean
- method initWithHTML(data as memoryblock, options as Dictionary, byref documentAttributes as dictionary) as boolean
- method initWithHTMLOld(data as string) as boolean
- method initWithPath(file as folderitem) as boolean
- method initWithPath(file as folderitem, byref documentAttributes as dictionary) as boolean
- method initWithPath(path as string) as boolean
- method initWithPath(path as string, byref documentAttributes as dictionary) as boolean
- method initWithRTF(data as MemoryBlock) as boolean
- method initWithRTF(data as memoryblock, byref documentAttributes as dictionary) as boolean
- method initWithRTFD(data as MemoryBlock) as boolean
- method initWithRTFD(data as memoryblock, byref documentAttributes as dictionary) as boolean
- method initWithString(text as string) as boolean
- method initWithString(text as string, withAttributes as Dictionary) as boolean
- method initWithURL(file as folderitem) as boolean
- method initWithURL(file as folderitem, byref documentAttributes as dictionary) as boolean
- method initWithURL(url as string) as boolean
- method initWithURL(url as string, byref documentAttributes as dictionary) as boolean
- method isEqualToAttributedString(other as NSAttributedStringMBS) as Boolean
- method itemNumberInTextList(list as NSTextListMBS, location as Integer) as Integer
- method lineRangeForRange(range as NSRangeMBS) as NSRangeMBS
- method mutableCopy as NSMutableAttributedStringMBS
- method paragraphRangeForRange(range as NSRangeMBS) as NSRangeMBS
- method rangeOfTextBlock(textBlock as NSTextBlockMBS, location as Integer) as NSRangeMBS
- method rangeOfTextList(list as NSTextListMBS, location as Integer) as NSRangeMBS
- method rangeOfTextTable(textTable as NSTextTableMBS, location as Integer) as NSRangeMBS
- method rtf as MemoryBlock
- method RTFDFileWrapperFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil) as NSFileWrapperMBS
- method RTFDFromRange(documentAttributes as dictionary = nil) as MemoryBlock
- method RTFDFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil) as MemoryBlock
- method RTFFromRange(documentAttributes as dictionary = nil) as MemoryBlock
- method RTFFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil) as MemoryBlock
- 110 shared methods
- shared method attributedStringWithAttachment(attachment as NSTextAttachmentMBS) as NSAttributedStringMBS
- shared method attributedStringWithAttributedString(text as NSAttributedStringMBS) as NSAttributedStringMBS
- shared method attributedStringWithDocFormat(data as memoryblock) as NSAttributedStringMBS
- shared method attributedStringWithDocFormat(data as memoryblock, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
- shared method attributedStringWithHTML(data as memoryblock) as NSAttributedStringMBS
- shared method attributedStringWithHTML(data as memoryblock, BaseURL as string) as NSAttributedStringMBS
- shared method attributedStringWithHTML(data as memoryblock, BaseURL as string, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
- shared method attributedStringWithHTML(data as memoryblock, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
- shared method attributedStringWithHTMLOld(data as string) as NSAttributedStringMBS
- shared method attributedStringWithPath(file as folderitem) as NSAttributedStringMBS
- shared method attributedStringWithPath(file as folderitem, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
- shared method attributedStringWithPath(path as string) as NSAttributedStringMBS
- shared method attributedStringWithPath(path as string, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
- shared method attributedStringWithRTF(data as memoryblock) as NSAttributedStringMBS
- shared method attributedStringWithRTF(data as memoryblock, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
- shared method attributedStringWithRTFD(data as memoryblock) as NSAttributedStringMBS
- shared method attributedStringWithRTFD(data as memoryblock, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
- shared method attributedStringWithString(text as string) as NSAttributedStringMBS
- shared method attributedStringWithString(text as string, withAttributes as dictionary) as NSAttributedStringMBS
- shared method attributedStringWithURL(file as folderitem) as NSAttributedStringMBS
- shared method attributedStringWithURL(file as folderitem, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
- shared method attributedStringWithURL(url as string) as NSAttributedStringMBS
- shared method attributedStringWithURL(url as string, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
- shared method FromClipboard as NSAttributedStringMBS
- shared method NSAttachmentAttributeName as string
- shared method NSAuthorDocumentAttribute as string
- shared method NSBackgroundColorAttributeName as string
- shared method NSBackgroundColorDocumentAttribute as string
- shared method NSBaselineOffsetAttributeName as string
- shared method NSBaseURLDocumentOption as string
- shared method NSBottomMarginDocumentAttribute as string
- shared method NSCategoryDocumentAttribute as string
- shared method NSCharacterEncodingDocumentAttribute as string
- shared method NSCharacterEncodingDocumentOption as string
- shared method NSCharacterShapeAttributeName as string
- shared method NSCocoaVersionDocumentAttribute as string
- shared method NSCommentDocumentAttribute as string
- shared method NSCompanyDocumentAttribute as string
- shared method NSConvertedDocumentAttribute as string
- shared method NSCopyrightDocumentAttribute as string
- shared method NSCreationTimeDocumentAttribute as string
- shared method NSCursorAttributeName as string
- shared method NSDefaultAttributesDocumentAttribute as string
- shared method NSDefaultAttributesDocumentOption as string
- shared method NSDefaultTabIntervalDocumentAttribute as string
- shared method NSDocFormatTextDocumentType as string
- shared method NSDocumentTypeDocumentAttribute as string
- shared method NSDocumentTypeDocumentOption as string
- shared method NSEditorDocumentAttribute as string
- shared method NSExcludedElementsDocumentAttribute as string
- shared method NSExpansionAttributeName as string
- shared method NSFileTypeDocumentAttribute as string
- shared method NSFileTypeDocumentOption as string
- shared method NSFontAttributeName as string
- shared method NSForegroundColorAttributeName as string
- shared method NSGlyphInfoAttributeName as string
- shared method NSHTMLTextDocumentType as string
- shared method NSHyphenationFactorDocumentAttribute as string
- shared method NSKernAttributeName as string
- shared method NSKeywordsDocumentAttribute as string
- shared method NSLeftMarginDocumentAttribute as string
- shared method NSLigatureAttributeName as string
- shared method NSLinkAttributeName as string
- shared method NSMacSimpleTextDocumentType as string
- shared method NSManagerDocumentAttribute as string
- shared method NSMarkedClauseSegmentAttributeName as string
- shared method NSModificationTimeDocumentAttribute as string
- shared method NSObliquenessAttributeName as string
- shared method NSOfficeOpenXMLTextDocumentType as string
- shared method NSOpenDocumentTextDocumentType as string
- shared method NSPaperSizeDocumentAttribute as string
- shared method NSParagraphStyleAttributeName as string
- shared method NSPlainTextDocumentType as string
- shared method NSPrefixSpacesDocumentAttribute as string
- shared method NSReadOnlyDocumentAttribute as string
- shared method NSRightMarginDocumentAttribute as string
- shared method NSRTFDTextDocumentType as string
- shared method NSRTFTextDocumentType as string
- shared method NSShadowAttributeName as string
- shared method NSSpellingStateAttributeName as string
- shared method NSStrikethroughColorAttributeName as string
- shared method NSStrikethroughStyleAttributeName as string
- shared method NSStrokeColorAttributeName as string
- shared method NSStrokeWidthAttributeName as string
- shared method NSSubjectDocumentAttribute as string
- shared method NSSuperscriptAttributeName as string
- shared method NSTextAlternativesAttributeName as string
- shared method NSTextEffectAttributeName as string
- shared method NSTextEffectLetterpressStyle as string
- shared method NSTextEncodingNameDocumentAttribute as string
- shared method NSTextEncodingNameDocumentOption as string
- shared method NSTextLayoutSectionOrientation as string
- shared method NSTextLayoutSectionRange as string
- shared method NSTextLayoutSectionsAttribute as string
- shared method NSTextSizeMultiplierDocumentOption as string
- shared method NSTimeoutDocumentOption as string
- shared method NSTitleDocumentAttribute as string
- shared method NSToolTipAttributeName as string
- shared method NSTopMarginDocumentAttribute as string
- shared method NSUnderlineColorAttributeName as string
- shared method NSUnderlineStyleAttributeName as string
- shared method NSVerticalGlyphFormAttributeName as string
- shared method NSViewModeDocumentAttribute as string
- shared method NSViewSizeDocumentAttribute as string
- shared method NSViewZoomDocumentAttribute as string
- shared method NSWebArchiveTextDocumentType as string
- shared method NSWebPreferencesDocumentOption as string
- shared method NSWebResourceLoadDelegateDocumentOption as string
- shared method NSWordMLTextDocumentType as string
- shared method NSWritingDirectionAttributeName as string
- 14 constants
- const NSSpellingStateSpellingFlag = 0
Spelling Constants.
Constant | Value | Description |
---|---|---|
NSSpellingStateGrammarFlag | 1 |
Flag for grammar issues. |
Underline Constants.
Constant | Value | Description |
---|---|---|
NSUnderlineByWord | &h8000 |
Draw the line only underneath or through words, not whitespace. |
NSUnderlinePatternDash | &h0200 |
Draw a line of dashes. |
NSUnderlinePatternDashDot | &h0300 |
Draw a line of alternating dashes and dots. |
NSUnderlinePatternDashDotDot | &h0400 |
Draw a line of alternating dashes and two dots. |
NSUnderlinePatternDot | &h0100 |
Draw a line of dots. |
NSUnderlinePatternSolid | 0 |
Draw a solid line. |
NSUnderlineStyleDouble | 9 |
Draw a double line. |
NSUnderlineStyleNone | 0 |
Do not draw a line. |
NSUnderlineStyleSingle | 1 |
Draw a single line. |
NSUnderlineStyleThick | 2 |
Draw a thick line. |
Writing Direction Constants.
Constant | Value | Description |
---|---|---|
NSWritingDirectionEmbedding | 0 |
Text is embedded in text with another writing direction. For example, an English quotation in the middle of an Arabic sentence could be marked as being embedded left-to-right text. |
NSWritingDirectionOverride | 1 |
Enables character types with inherent directionality to be overridden when required for special cases, such as for part numbers made of mixed English, digits, and Hebrew letters to be written from right to left. |
Sub classes:
Some methods using this class:
- ABAddressBookMBS.formattedAddressFromDictionary(address as Dictionary) as NSAttributedStringMBS
- CNPostalAddressFormatterMBS.attributedStringFromPostalAddress(postalAddress as CNPostalAddressMBS, DefaultAttributes as Dictionary = nil) as NSAttributedStringMBS
- NSGraphicsMBS.drawAtPoint(text as NSAttributedStringMBS, point as NSPointMBS)
- NSGraphicsMBS.drawWithRect(text as NSAttributedStringMBS, rect as NSRectMBS, options as Integer)
- NSMutableAttributedStringMBS.replaceCharactersInRange(range as NSRangeMBS, attrString as NSAttributedStringMBS)
- NSSharingServiceItemsMBS.AddAttributedString(AttributedString as NSAttributedStringMBS)
- NSSharingServiceItemsMBS.AddAttributedString(AttributedStrings() as NSAttributedStringMBS)
- NSViewMBS.pageFooter as NSAttributedStringMBS
- NSViewMBS.pageHeader as NSAttributedStringMBS
- OSALanguageInstanceMBS.richTextFromDescriptor(descriptor as NSAppleEventDescriptorMBS) as NSAttributedStringMBS
Some properties using for this class:
- CIFilterAttributedTextImageGeneratorMBS.inputText as NSAttributedStringMBS
- NSButtonCellMBS.attributedTitle as NSAttributedStringMBS
- NSButtonMBS.attributedTitle as NSAttributedStringMBS
- NSCellMBS.attributedStringValue as NSAttributedStringMBS
- NSLayoutManagerMBS.attributedString as NSAttributedStringMBS
- NSTextFieldCellMBS.placeholderAttributedString as NSAttributedStringMBS
- OSAScriptMBS.richTextSource as NSAttributedStringMBS
- PDFAnnotationTextWidgetMBS.attributedStringValue as NSAttributedStringMBS
- PDFPageMBS.attributedString as NSAttributedStringMBS
- IKPictureTakerMBS.InformationalText as NSAttributedStringMBS
Some examples using this class:
- /MacBase/Custom NSWindows/NSWindow with Pattern/Pattern NSWindow
- /MacCG/Attributed String print
- /MacCocoa/Addressbook/Show my entry
- /MacCocoa/AppleScript/AppleScript Editor Cocoa
- /MacCocoa/NSStatusItem/StatusItem
- /MacCocoa/NSStatusItem/StatusItem with CarbonEvents
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/TextArea with Link
- /MacControls/TextEdit MBS
Blog Entries
- RTF functions in MBS Plugins
- News from the MBS Xojo Plugins Version 22.2
- MonkeyBread Software Releases the MBS Xojo Plugins in version 22.0
- News from the MBS Xojo Plugins in version 21.5
- MonkeyBread Software Releases the MBS Xojo Plugins in version 21.2
- MBS Xojo plug-ins in version 16.0
- Tip of the day: Adding links to Textarea on OS X
- Extracting text from files
- Using NSTextViewMBS
- MBS Releases the MBS Real Studio plug-ins in version 12.0
Xojo Developer Magazine
- 5.6, page 32: Third Party Plugins: Statusitems, Getting an icon in the top right of the Mac OS X menubar by Christian Schmitz
- 20.2, page 10: News
- 19.4, page 10: News
- 10.3, page 9: News
The items on this page are in the following plugins: MBS MacBase Plugin.
NSApplicationMBS - NSAutoreleasePoolMBS
