Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

NSPasteboardMBS.addType(type as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Adds promises for the specified types to the first pasteboard item.
Notes:
types: An array of strings, each of which specifies a type of data that can be provided to the pasteboard.

Returns the new change count, or 0 if there was an error adding the types.

This method adds promises for the specified types to the first pasteboard item.

You use this methods to declare additional types of data for the first pasteboard item in the receiver. You can also use it to replace existing types added by a previous declareTypes or addTypes call.

The types parameter specifies the types of data you are promising to the pasteboard. The types should be ordered according to the preference of the source application, with the most preferred type coming first (typically, the richest representation). New types are added to the end of the list containing any existing types, if any.

If you specify a type that has already been declared, this method replaces the owner of that type with the value in newOwner. In addition, any data already already written to the pasteboard for that type is removed.

Feedback, Comments & Corrections

NSPasteboardMBS.addTypes(types() as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Adds promises for the specified types to the first pasteboard item.
Notes:
types: An array of strings, each of which specifies a type of data that can be provided to the pasteboard.

Returns the new change count, or 0 if there was an error adding the types.

This method adds promises for the specified types to the first pasteboard item.

You use this methods to declare additional types of data for the first pasteboard item in the receiver. You can also use it to replace existing types added by a previous declareTypes or addTypes call.

The types parameter specifies the types of data you are promising to the pasteboard. The types should be ordered according to the preference of the source application, with the most preferred type coming first (typically, the richest representation). New types are added to the end of the list containing any existing types, if any.

If you specify a type that has already been declared, this method replaces the owner of that type with the value in newOwner. In addition, any data already already written to the pasteboard for that type is removed.

Feedback, Comments & Corrections

NSPasteboardMBS.changeCount as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Returns the receiver's change count.
Example:
dim p as new NSPasteboardMBS(NSPasteboardMBS.NSGeneralPboard)

MsgBox str(p.changeCount)
Notes:
The change count starts at zero when a client creates the receiver and becomes the first owner. The change count subsequently increments each time the pasteboard ownership changes.

The change count is also returned from clearContents and declareTypes. You can therefore record the change count at the time that you take ownership of the pasteboard and later compare it with the value returned from changeCount to determine whether you still have ownership.

Feedback, Comments & Corrections

NSPasteboardMBS.clearContents as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Clears the existing contents of the pasteboard.
Example:
dim p as new NSPasteboardMBS(NSPasteboardMBS.NSGeneralPboard)

MsgBox str(p.clearContents)
Notes:
Clears the existing contents of the pasteboard, preparing it for new contents. This is the first step in providing data on the pasteboard.

Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSPasteboardMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Creates a new NSPasteboardMBS object linked to the general NSPasteboard object.
Example:
dim p as new NSPasteboardMBS

MsgBox join(p.types,EndOfLine)
Notes: On success the handle property is not 0.

See also:

Feedback, Comments & Corrections

NSPasteboardMBS.Constructor(name as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Creates a new NSPasteboardMBS object linked to the pasteboard with the specified name.
Example:
dim p as new NSPasteboardMBS(NSPasteboardMBS.NSFindPboard)

// shows last find string
MsgBox p.stringForType(p.NSPasteboardTypeString)
Notes: On success the handle property is not 0.

See also:

Feedback, Comments & Corrections

NSPasteboardMBS.dataForType(type as string) as Memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Get the data for the specified type from the first item in the receiver that contains the type or sets the given data as the representation for the specified type for the first item on the receiver.
Example:
dim p as new NSPasteboardMBS

// may have chr(0) on the end!
MsgBox p.dataForType(p.NSPasteboardTypeString)
Notes:
Returns a data object containing the data for the specified type from the first item in the receiver that contains the type, or "" if the contents of the pasteboard changed since they were last checked.

This method may also return nil if the pasteboard server cannot supply the data in time—for example, if the pasteboard's owner is slow in responding to a pasteboard:provideDataForType: message and the interprocess communication times out.

Errors other than a timeout raise a NSPasteboardCommunicationException (a NSExceptionMBS in Real Studio).

If "" is returned, the application should put up a panel informing the user that it was unable to carry out the paste operation.

For standard text data types such as string, RTF, and RTFD, the text data from each item is returned as one combined result separated by newlines.
(Read and Write computed property)

Feedback, Comments & Corrections

NSPasteboardMBS.declareType(type as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Prepares the receiver for a change in its contents by declaring the new types of data it will contain.
Notes:
type: An strings that specify the type of data that may be added to the new pasteboard. The types should be ordered according to the preference of the source application, with the most preferred type coming first (typically, the richest representation).

Returns the receiver's new change count.

This method is the equivalent of invoking clearContents, implicitly writing the first pasteboard item, and then calling addTypes to promise types for the first pasteboard item.

In Mac OS X v10.5 and earlier, this method is the first step in writing data to the pasteboard and must precede the messages that actually write the data. A declareTypes message essentially changes the contents of the receiver: It invalidates the current contents of the receiver and increments its change count.

Feedback, Comments & Corrections

NSPasteboardMBS.declareTypes(types() as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Prepares the receiver for a change in its contents by declaring the new types of data it will contain.
Notes:
type: An array of Strings that specify the types of data that may be added to the new pasteboard. The types should be ordered according to the preference of the source application, with the most preferred type coming first (typically, the richest representation).

Returns the receiver's new change count.

This method is the equivalent of invoking clearContents, implicitly writing the first pasteboard item, and then calling addTypes to promise types for the first pasteboard item.

In Mac OS X v10.5 and earlier, this method is the first step in writing data to the pasteboard and must precede the messages that actually write the data. A declareTypes message essentially changes the contents of the receiver: It invalidates the current contents of the receiver and increments its change count.

Feedback, Comments & Corrections

NSPasteboardMBS.name as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Returns the receiver's name.
Example:
dim p as new NSPasteboardMBS

MsgBox p.name

Feedback, Comments & Corrections

NSPasteboardMBS.pasteboardItems as NSPasteboardItemMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Returns all the items held by the receiver.
Notes:
Returns all the items held by the receiver, or nil if there is an error retrieving pasteboard items.
Available in OS X v10.6 and later.

Feedback, Comments & Corrections

NSPasteboardMBS.propertyListForType(type as string) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Clipboard MBS MacBase Plugin 13.5 Yes No No Yes, macOS only No
Function: The property list for the specified type from the first item in the receiver that contains the type.
Notes:
dataType: The pasteboard data type containing the property-list data.

The property list for the specified type from the first item in the receiver that contains the type. This object consists of NSArray, NSData, NSDictionary, or NSString objects—or any combination thereof.

This method invokes the dataForType method.
You must send types or availableTypeFromArray before invoking propertyListForType.
(Read and Write computed property)

Feedback, Comments & Corrections

NSPasteboardMBS.releaseGlobally
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Releases the receiver's resources in the pasteboard server.
Notes:
After this method is invoked, no other application can use the receiver.

A temporary, privately named pasteboard can be released this way when it is no longer needed, but a standard pasteboard should never be released globally.

Feedback, Comments & Corrections

NSPasteboardMBS.SetPasteboardItems(items() as NSPasteboardItemMBS) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 17.1 Yes No No Yes, macOS only No
Function: Writes pasteboard items to the pasteboard.
Notes: Returns true if the array was successfully added, otherwise false.

Feedback, Comments & Corrections

NSPasteboardMBS.stringForType(type as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Get/Set the given string as the representation for the specified type for the first item on the receiver.
Example:
dim p as new NSPasteboardMBS

MsgBox p.stringForType(p.NSPasteboardTypeString)
Notes:
A concatenation of the strings for the specified type from all the items in the receiver that contain the type, or nil if none of the items contain strings of the specified type.

This method invokes dataForType to obtain the string. If the string cannot be obtained, stringForType returns "". See dataForType for a description of what will cause "" to be returned.

In Mac OS X v10.6 and later, if the receiver contains multiple items that can provide string, RTF, or RTFD data, the text data from each item is returned as a combined result separated by newlines.
(Read and Write computed property)

Feedback, Comments & Corrections

NSPasteboardMBS.types as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 10.4 Yes No No Yes, macOS only No
Function: Returns an array of the receiver's supported data types.
Example:
dim p as new NSPasteboardMBS

MsgBox join(p.types,EndOfLine)
Notes:
An array of Strings containing the union of the types of data declared for all the pasteboard items on the receiver. The returned types are listed in the order they were declared.

You must send a types or availableTypeFromArray message before reading any data from an NSPasteboard object.

Feedback, Comments & Corrections

NSPasteboardMBS.URLFromPasteboard as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Reads the URL string off of pasteboard.
Notes: Returns "" if pasteboard does not contain data of type NSURLPboardType.

Feedback, Comments & Corrections

NSPasteboardMBS.writeURLToPasteboard(URL as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Clipboard MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Writes the receiver to pasteboard.
Notes: You must declare an NSURLPboardType data type for pasteboard before invoking this method; otherwise it returns without doing anything.

Feedback, Comments & Corrections

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





Links
MBS FileMaker Plugins