Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSAttributedStringMBS class.
NSAttributedStringMBS.AsCFAttributedString as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
For passing to functions which need a CFAttributedStringMBS.
Some examples using this method:
NSAttributedStringMBS.attributeAtIndex(name as string, location as UInt64) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
name: The name of an attribute.
location: The index for which to return attributes. This value must not exceed the bounds of the receiver.
effectiveRange: Optional. If the named attribute exists at index, upon return aRange contains a range over which the named attribute's value applies. If the named attribute does not exist at index, upon return aRange contains the range over which the attribute does not exist.
The range isn't necessarily the maximum range covered by attributeName, and its extent is implementation-dependent. If you need the maximum range, use the other variant of this method.
Returns the value for the attribute named attributeName of the character at index index, or nil if there is no such attribute.
Raises an NSRangeException if index lies beyond the end of the receiver's characters.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
Some examples using this method:
NSAttributedStringMBS.attributeAtIndex(name as string, location as UInt64, inRange as NSRangeMBS) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
name: The name of an attribute.
location: The index at which to test for attributeName.
longestEffectiveRange: Optional. If the named attribute exists at index, upon return aRange contains the full range over which the value of the named attribute is the same as that at index, clipped to rangeLimit. If the named attribute does not exist at index, upon return aRange contains the full range over which the attribute does not exist, clipped to rangeLimit.
inRange: The range over which to search for continuous presence of attributeName. This value must not exceed the bounds of the receiver.
Returns the value for the attribute named attributeName of the character at index, or nil if there is no such attribute.
Raises an NSRangeException if index or any part of rangeLimit lies beyond the end of the receiver's characters.
If you don't need the longest effective range, it's far more efficient to use the other variant method to retrieve the attribute value.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
NSAttributedStringMBS.attributeAtIndex2(name as string, location as UInt64, byref effectiveRange as NSRangeMBS) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
name: The name of an attribute.
location: The index for which to return attributes. This value must not exceed the bounds of the receiver.
effectiveRange: Optional. If the named attribute exists at index, upon return aRange contains a range over which the named attribute's value applies. If the named attribute does not exist at index, upon return aRange contains the range over which the attribute does not exist.
The range isn't necessarily the maximum range covered by attributeName, and its extent is implementation-dependent. If you need the maximum range, use the other variant of this method.
Returns the value for the attribute named attributeName of the character at index index, or nil if there is no such attribute.
Raises an NSRangeException if index lies beyond the end of the receiver's characters.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
NSAttributedStringMBS.attributeAtIndex2(name as string, location as UInt64, byref longestEffectiveRange as NSRangeMBS, inRange as NSRangeMBS) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
name: The name of an attribute.
location: The index at which to test for attributeName.
longestEffectiveRange: Optional. If the named attribute exists at index, upon return aRange contains the full range over which the value of the named attribute is the same as that at index, clipped to rangeLimit. If the named attribute does not exist at index, upon return aRange contains the full range over which the attribute does not exist, clipped to rangeLimit.
inRange: The range over which to search for continuous presence of attributeName. This value must not exceed the bounds of the receiver.
Returns the value for the attribute named attributeName of the character at index, or nil if there is no such attribute.
Raises an NSRangeException if index or any part of rangeLimit lies beyond the end of the receiver's characters.
If you don't need the longest effective range, it's far more efficient to use the other variant method to retrieve the attribute value.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
NSAttributedStringMBS.attributedSubstringFromRange(range as NSRangeMBS) as NSAttributedStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Range: The range from which to create a new attributed string. aRange must lie within the bounds of the receiver.
Returns an NSAttributedString object consisting of the characters and attributes within aRange in the receiver.
Raises an NSRangeException if any part of aRange lies beyond the end of the receiver's characters. This method treats the length of the string as a valid range value that returns an empty string.
NSAttributedStringMBS.attributesAtIndex(location as UInt64) as dictionary
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The index for which to return attributes. This value must lie within the bounds of the receiver.
Range: Optional. Upon return, the range over which the attributes and values are the same as those at index. This range isn't necessarily the maximum range covered, and its extent is implementation-dependent. If you need the maximum range, use other variant of this method.
Returns the attributes for the character at index.
Raises an NSRangeException if index lies beyond the end of the receiver's characters.
See also:
Some examples using this method:
NSAttributedStringMBS.attributesAtIndex(location as UInt64, inRange as NSRangeMBS) as dictionary
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The index for which to return attributes. This value must not exceed the bounds of the receiver.
range: Optional. Upon return contains the maximum range over which the attributes and values are the same as those at index, clipped to range Limit.
inRange: The range over which to search for continuous presence of the attributes at index. This value must not exceed the bounds of the receiver.
Raises an NSRangeException if index or any part of rangeLimit lies beyond the end of the receiver's characters.
If you don't need the range information, it's far more efficient to use the other variant of this method to retrieve the attribute value.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
NSAttributedStringMBS.attributesAtIndex2(location as UInt64, byref range as NSRangeMBS) as dictionary
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The index for which to return attributes. This value must lie within the bounds of the receiver.
Range: Optional. Upon return, the range over which the attributes and values are the same as those at index. This range isn't necessarily the maximum range covered, and its extent is implementation-dependent. If you need the maximum range, use other variant of this method.
Returns the attributes for the character at index.
Raises an NSRangeException if index lies beyond the end of the receiver's characters.
See also:
NSAttributedStringMBS.attributesAtIndex2(location as UInt64, byref range as NSRangeMBS, inRange as NSRangeMBS) as dictionary
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The index for which to return attributes. This value must not exceed the bounds of the receiver.
range: Optional. Upon return contains the maximum range over which the attributes and values are the same as those at index, clipped to range Limit.
inRange: The range over which to search for continuous presence of the attributes at index. This value must not exceed the bounds of the receiver.
Raises an NSRangeException if index or any part of rangeLimit lies beyond the end of the receiver's characters.
If you don't need the range information, it's far more efficient to use the other variant of this method to retrieve the attribute value.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
NSAttributedStringMBS.Constructor
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 19.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSAttributedStringMBS.Convert_Operator as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 18.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSAttributedStringMBS.copy as NSAttributedStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSAttributedStringMBS.CopyToClipboard as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 18.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSAttributedStringMBS.dataFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil, byref error as NSErrorMBS) as memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 16.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
offset and length: The range.
documentAttributes: A required dictionary specifying the document attributes. The dictionary contains values from Document Types and must at least contain NSDocumentTypeDocumentAttribute.
error: An in-out variable containing an encountered error, if any.
Returns the data for the attributed string, or nil if failure. When nil, error encapsulates the error information.
Raises an NSRangeException if any part of range lies beyond the end of the receiver’s characters.
NSAttributedStringMBS.docFormatFromRange(documentAttributes as dictionary = nil) as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Same as docFormatFromRange(0,length)
Returns nil on failure.
documentAttributes can optionally be a dictionary with document attributes like author or title.
See also:
Some examples using this method:
NSAttributedStringMBS.docFormatFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil) as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns nil on failure.
documentAttributes can optionally be a dictionary with document attributes like author or title.
See also:
NSAttributedStringMBS.fileWrapperFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil, byref Error as NSErrorMBS) as NSFileWrapperMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 16.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
offset and length: The range.
documentAttributes: A required dictionary specifying the document attributes. The dictionary contains values from Document Types and must at least contain NSDocumentTypeDocumentAttribute.
error: An in-out variable containing an encountered error, if any.
Returns a file wrapper for the appropriate document type, or nil if failure. When nil, error encapsulates the error information.
Raises an NSRangeException if any part of range lies beyond the end of the receiver’s characters.
NSAttributedStringMBS.GeneratePDF(PrintOptions as Variant = nil) as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 16.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
PrintOptions is optional NSPrintInfoMBS object for print settings like margin.
NSAttributedStringMBS.htmlString as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Does not always work well, but can help.
(Apple has no official function for this)
Some examples using this method:
NSAttributedStringMBS.initWithAttributedString(text as NSAttributedStringMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on success.
NSAttributedStringMBS.initWithDocFormat(data as MemoryBlock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns true on success.
documentAttributes: Optional dictionary to receive the attributes.
See also:
NSAttributedStringMBS.initWithDocFormat(data as memoryblock, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns true on success.
documentAttributes: Optional dictionary to receive the attributes.
See also:
NSAttributedStringMBS.initWithHTML(data as MemoryBlock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
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:
- initWithHTML(data as MemoryBlock, BaseURL as string) as boolean
- initWithHTML(data as memoryblock, BaseURL as string, byref documentAttributes as dictionary) as boolean
- initWithHTML(data as memoryblock, byref documentAttributes as dictionary) as boolean
- initWithHTML(data as memoryblock, options as Dictionary, byref documentAttributes as dictionary) as boolean
NSAttributedStringMBS.initWithHTML(data as MemoryBlock, BaseURL as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on success.
documentAttributes: Optional dictionary to receive the attributes.
See also:
- initWithHTML(data as MemoryBlock) as boolean
- initWithHTML(data as memoryblock, BaseURL as string, byref documentAttributes as dictionary) as boolean
- initWithHTML(data as memoryblock, byref documentAttributes as dictionary) as boolean
- initWithHTML(data as memoryblock, options as Dictionary, byref documentAttributes as dictionary) as boolean
NSAttributedStringMBS.initWithHTML(data as memoryblock, BaseURL as string, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on success.
documentAttributes: Optional dictionary to receive the attributes.
See also:
- initWithHTML(data as MemoryBlock) as boolean
- initWithHTML(data as MemoryBlock, BaseURL as string) as boolean
- initWithHTML(data as memoryblock, byref documentAttributes as dictionary) as boolean
- initWithHTML(data as memoryblock, options as Dictionary, byref documentAttributes as dictionary) as boolean
NSAttributedStringMBS.initWithHTML(data as memoryblock, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on success.
documentAttributes: Optional dictionary to receive the attributes.
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:
- initWithHTML(data as MemoryBlock) as boolean
- initWithHTML(data as MemoryBlock, BaseURL as string) as boolean
- initWithHTML(data as memoryblock, BaseURL as string, byref documentAttributes as dictionary) as boolean
- initWithHTML(data as memoryblock, options as Dictionary, byref documentAttributes as dictionary) as boolean
NSAttributedStringMBS.initWithHTML(data as memoryblock, options as Dictionary, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 22.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on success.
options: Put in some options for parsing the document like NSCharacterEncodingDocumentOption or NSTextEncodingNameDocumentOption.
documentAttributes: Optional dictionary to receive the attributes.
See also:
NSAttributedStringMBS.initWithHTMLOld(data as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
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
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithPath(file as folderitem, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithPath(path as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithPath(path as string, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithRTF(data as MemoryBlock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
Some examples using this method:
NSAttributedStringMBS.initWithRTF(data as memoryblock, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithRTFD(data as MemoryBlock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
The items on this page are in the following plugins: MBS MacBase Plugin.