Platforms to show: All Mac Windows Linux Cross-Platform
NSPasteboardMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Clipboard | MBS MacBase Plugin | 10.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSPasteboard objects transfer data to and from the pasteboard server. The server is shared by all running applications. It contains data that the user has cut or copied, as well as other data that one application wants to transfer to another. NSPasteboard objects are an application's sole interface to the server and to all pasteboard operations.
An NSPasteboard object is also used to transfer data between applications and service providers listed in each application's Services menu. The drag pasteboard (NSDragPboard) is used to transfer data that is being dragged by the user.
The plugin class NSPasteboardMBS does not implement all features of the NSPasteboard. If you miss something, please email us.
- 4 properties
- property Handle as Integer
- property dataForType(type as string) as Memoryblock
- property propertyListForType(type as string) as Variant
- property stringForType(type as string) as string
- 20 methods
- method accessBehavior as Integer New in 25.3
- method addType(type as string) as Integer
- method addTypes(types() as string) as Integer
- method changeCount as Integer
- method clearContents as Integer
- method Constructor
- method Constructor(name as string)
- method declareType(type as string) as Integer
- method declareTypes(types() as string) as Integer
- method detectMetadata(types() as String, theDelegate as detectValuesCompletedMBS, tag as variant = nil) New in 25.3
- method detectPatterns(patterns() as String, theDelegate as detectPatternsCompletedMBS, tag as variant = nil) New in 25.3
- method detectValues(patterns() as String, theDelegate as detectValuesCompletedMBS, tag as variant = nil) New in 25.3
- method name as string
- method pasteboardItems as NSPasteboardItemMBS()
- method releaseGlobally
- method SetPasteboardItems(items() as NSPasteboardItemMBS) as Boolean
- method SetPasteboardItems(items() as Variant) as boolean
- method types as string()
- method URLFromPasteboard as string
- method writeURLToPasteboard(URL as string)
- 52 shared methods
- shared method generalPasteboard as NSPasteboardMBS
- shared method NSColorPboardType as string
- shared method NSDragPboard as string
- shared method NSFilenamesPboardType as string
- shared method NSFilesPromisePboardType as string
- shared method NSFindPboard as string
- shared method NSFontPboard as string
- shared method NSFontPboardType as string
- shared method NSGeneralPboard as string
- shared method NSHTMLPboardType as string
- shared method NSInkTextPboardType as string
- shared method NSMultipleTextSelectionPboardType as string
- shared method NSPasteboardDetectionPatternCalendarEvent as string New in 25.3
- shared method NSPasteboardDetectionPatternEmailAddress as string New in 25.3
- shared method NSPasteboardDetectionPatternFlightNumber as string New in 25.3
- shared method NSPasteboardDetectionPatternLink as string New in 25.3
- shared method NSPasteboardDetectionPatternMoneyAmount as string New in 25.3
- shared method NSPasteboardDetectionPatternNumber as string New in 25.3
- shared method NSPasteboardDetectionPatternPhoneNumber as string New in 25.3
- shared method NSPasteboardDetectionPatternPostalAddress as string New in 25.3
- shared method NSPasteboardDetectionPatternProbableWebSearch as string New in 25.3
- shared method NSPasteboardDetectionPatternProbableWebURL as string New in 25.3
- shared method NSPasteboardDetectionPatternShipmentTrackingNumber as string New in 25.3
- shared method NSPasteboardMetadataTypeContentType as string New in 25.3
- shared method NSPasteboardTypeColor as string
- shared method NSPasteboardTypeFindPanelSearchOptions as string
- shared method NSPasteboardTypeFont as string
- shared method NSPasteboardTypeHTML as string
- shared method NSPasteboardTypeMultipleTextSelection as string
- shared method NSPasteboardTypePDF as string
- shared method NSPasteboardTypePNG as string
- shared method NSPasteboardTypeRTF as string
- shared method NSPasteboardTypeRTFD as string
- shared method NSPasteboardTypeRuler as string
- shared method NSPasteboardTypeSound as string
- shared method NSPasteboardTypeString as string
- shared method NSPasteboardTypeTabularText as string
- shared method NSPasteboardTypeTIFF as string
- shared method NSPDFPboardType as string
- shared method NSPICTPboardType as string
- shared method NSPostScriptPboardType as string
- shared method NSRTFDPboardType as string
- shared method NSRTFPboardType as string
- shared method NSRulerPboard as string
- shared method NSRulerPboardType as string
- shared method NSStringPboardType as string
- shared method NSTabularTextPboardType as string
- shared method NSTIFFPboardType as string
- shared method NSURLPboardType as string
- shared method NSVCardPboardType as string
- shared method pasteboardWithName(name as string) as NSPasteboardMBS
- shared method pasteboardWithUniqueName as NSPasteboardMBS
- 2 delegates
- delegate detectPatternsCompletedMBS(pasteboard as NSPasteboardMBS, requestedPatterns() as String, detectedPatterns() as String, Error as NSErrorMBS, tag as Variant) New in 25.3
- delegate detectValuesCompletedMBS(pasteboard as NSPasteboardMBS, requestedPatterns() as String, patterns as Dictionary, Error as NSErrorMBS, tag as Variant) New in 25.3
- 4 constants
Access Behavior
Constant | Value | Description |
---|---|---|
AccessBehaviorAlwaysAllow | 2 |
The system will automatically allow all pasteboard access, without notifying the user. The app is listed in the corresponding System Settings pane. |
AccessBehaviorAlwaysDeny | 3 |
The system will automatically deny all pasteboard access, without notifying the user. However, access that is both user originated and paste related will always be allowed, and will not result in a notification. The app is listed in the corresponding System Settings pane. |
AccessBehaviorAsk | 1 |
The system will notify the user and ask for permission before granting pasteboard access. However, access that is both user originated and paste related will always be allowed, and will not result in a notification. The app is listed in the corresponding System Settings pane. |
AccessBehaviorDefault | 0 | The default behavior for the General pasteboard is to ask upon programmatic access. All other pasteboards default to always allow access. more |
This class has no sub classes.
Blog Entries
- MBS Xojo Plugins, version 25.3pr1
- MBS Xojo Plugins, version 21.4pr2
- Windows, Xojo and the Clipboard
- MBS Xojo Plugins, version 17.1pr3
- New MBS REALbasic Plugin Version 10.4
- MBS REALbasic Plugins Version 10.4 release notes
- MBS REALbasic Plugins, version 10.4pr12
- Teaser: Clipboard classes
Release notes
- Version 25.3
- Added new methods to NSPasteboardMBS and NSPasteboardItemMBS classes to handle access behavior.
- Version 21.4
- Added SetPasteboardItems method taking array of variants to NSPasteboardMBS class.
- Version 17.1
- Added NSPasteboardMBS.SetPasteboardItems.
Some methods using this class:
- NSDraggingSessionMBS.draggingPasteboard as NSPasteboardMBS
- NSPasteboardItemMBS.detectMetadata(types() as String, theDelegate as NSPasteboardMBS.detectValuesCompletedMBS, tag as variant = nil)
- NSPasteboardItemMBS.detectPatterns(patterns() as String, theDelegate as NSPasteboardMBS.detectPatternsCompletedMBS, tag as variant = nil)
- NSPasteboardItemMBS.detectValues(patterns() as String, theDelegate as NSPasteboardMBS.detectValuesCompletedMBS, tag as variant = nil)
- NSViewMBS.dragImage(image as NSImageMBS, viewLocation as NSPointMBS, offset as NSSizeMBS, NSEvent as NSEventMBS, pboard as NSPasteboardMBS, source as NSViewMBS, slideFlag as boolean)
- NSWindowMBS.dragImage(image as NSImageMBS, viewLocation as NSPointMBS, offset as NSSizeMBS, NSEvent as NSEventMBS, pboard as NSPasteboardMBS, source as NSViewMBS, slideFlag as boolean)
Some events using this class:
- DesktopNSOutlineControlMBS.writeItems(items() as NSOutlineViewItemMBS, pasteboard as NSPasteboardMBS) as Boolean
- IKImageBrowserViewControlMBS.writeItemsAtIndexes(indexes as NSIndexSetMBS, pasteboard as NSPasteboardMBS) as Integer
- NSCollectionViewControlMBS.writeItems(indexPaths() as NSIndexPathMBS, Pasteboard as NSPasteboardMBS) as Boolean
- NSServiceProviderMBS.readSelectionFromPasteboard(pboard as NSPasteboardMBS) as Boolean
- NSServiceProviderMBS.ServiceInvoked(pboard as NSPasteboardMBS, userData as string, byref error as string)
- NSServiceProviderMBS.writeSelectionToPasteboard(pboard as NSPasteboardMBS, types() as String) as Boolean
- NSTableControlMBS.writeRowsWithIndexes(rowIndexes as NSIndexSetMBS, pboard as NSPasteboardMBS) as boolean
- NSTokenFieldControlMBS.readFromPasteboard(pboard as NSPasteboardMBS) as Variant()
- NSTokenFieldMBS.readFromPasteboard(pboard as NSPasteboardMBS) as Variant()
- NSTokenFieldMBS.writeRepresentedObjects(objects() as Variant, pboard as NSPasteboardMBS) as boolean
Some examples using this class:
- /MacCocoa/ClipboardSaver
- /MacCocoa/Custom NSViewControl Drag
- /MacCocoa/Service in Cocoa/TestService
- /MacControls/Custom NSView Drag
- /MacControls/Custom NSView Drop
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
- /Win/Clipboard/ClipboardSaver
Some related classes:
- class NSDraggingSessionMBS
- class NSErrorMBS
- class NSEventMBS
- class NSImageMBS
- class NSIndexPathMBS
- class NSIndexSetMBS
- class NSPasteboardItemMBS
- class NSServiceProviderMBS
- class NSSizeMBS
- class NSViewMBS
The items on this page are in the following plugins: MBS MacBase Plugin.
NSPasteboardItemMBS - NSPathComponentCellMBS
