Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSPasteboardItemMBS class.

NSPasteboardItemMBS.availableTypeFromArray(types() as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Clipboard MBS MacBase Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns from a given array of types the the first type contained in the pasteboard item, according to the ordering of types.

types: An array of strings representing UTIs, arranged in order of preference (most preferred as the 0th element in the array).

Returns the first (according to the sender's ordering of types) type in types contained in the pasteboard item, or nil if the receiver does not contain any types given in types.

The method checks for UTI conformance of the requested types, preferring an exact match to conformance.
Available in OS X v10.6 and later.

Some examples using this method:

NSPasteboardItemMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Clipboard MBS MacBase Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The constructor.

NSPasteboardItemMBS.dataForType(type as string) as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Clipboard MBS MacBase Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The value for a specified type as a memoryblock object.
Example
dim n as new NSPasteboardItemMBS

dim data as MemoryBlock = "Hello World"
dim type as string = NSPasteboardmbs.NSPasteboardTypeString
n.dataForType(type) = data

dim d as MemoryBlock = n.dataForType(type)
MsgBox DefineEncoding(d, encodings.UTF8)

(Read and Write computed property)

NSPasteboardItemMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Clipboard MBS MacBase Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The destructor.

NSPasteboardItemMBS.propertyListForType(type as string) as Variant

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Clipboard MBS MacBase Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The value for a specified type as a property list.

Stores a property list object (array, dictionary, string, numbers, memoryblocks)
Available in OS X v10.6 and later.
(Read and Write computed property)

NSPasteboardItemMBS.setDataProviderForType(dataProvider as NSPasteboardItemDataProviderMBS, types() as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Clipboard MBS MacBase Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Sets the data provider for the specified types.

dataProvider: A pasteboard data provider.
types: An array of strings indicating the UTIs for the data representations dataProvider may provide.

Returns true if the data provider was set successfully, otherwise false.

This method registers the data provider to be messaged to provide the data for any of the specified types when requested.
Available in OS X v10.6 and later.

Some examples using this method:

NSPasteboardItemMBS.stringForType(type as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Clipboard MBS MacBase Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The value for the specified type as a string.
Example
dim n as new NSPasteboardItemMBS

dim type as string = NSPasteboardmbs.NSPasteboardTypeString
n.stringForType(type) = "Hello World"
MsgBox n.stringForType(type)

type: A UTI type string.

Available in OS X v10.6 and later.
(Read and Write computed property)

NSPasteboardItemMBS.types as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Clipboard MBS MacBase Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns an array of UTI strings of the data types supported by the receiver.

Available in OS X v10.6 and later.

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


The biggest plugin in space...