Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSSharingServiceMBS class.

NSSharingServiceMBS.attachmentFileURLs as String()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Social MBS MacFrameworks Plugin 21.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Array of file URLs representing the files that were shared.

NSSharingServiceMBS.canPerformWithItems(items as NSSharingServiceItemsMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Social MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns whether the service can share all the specified items.

items: The items to share.

Return true if the service can share all the items; false otherwise. If items is nil, the method will return true when the service is configured.

This method can be used to validate a custom user interface such as a dedicated Twitter button. Therefore you could call it once at launch time with nil items to check whether to display the button or not, and then with real items to enable and disable the button depending on the context or selection.

Available in OS X v10.8 and later.

Some examples using this method:

NSSharingServiceMBS.Close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Social MBS MacFrameworks Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Closes the sharing services.

Same as destructor, but closes now, not later.

NSSharingServiceMBS.Constructor(name as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Social MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Create a sharing service instance representing the specified service name.

name: The service name. See NSSharingServiceName* methods.

NSSharingServiceMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Social MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The destructor.

NSSharingServiceMBS.performWithItems(items as NSSharingServiceItemsMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Social MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Manually performs the service on the provided items.

items: The items to share.

In most cases this will display a sharing window.
Available in OS X v10.8 and later.

NSSharingServiceMBS.recipients as String()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Social MBS MacFrameworks Plugin 21.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The list of recipients.

NSSharingServiceMBS.SetDelegate(DelegateHandler as NSSharingServiceDelegateMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Social MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Specifies the delegate of the sharing service.

NSSharingServiceMBS.setRecipients(recipients() as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Social MBS MacFrameworks Plugin 21.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the list of recipients.
Example
// compose email
Dim items As New NSSharingServiceItemsMBS

// styled text from text area control
Dim tv As NSTextViewMBS = TextArea1.NSTextViewMBS
items.AddAttributedString tv.textStorage

// find service
Dim service As New NSSharingServiceMBS("com.apple.share.Mail.compose")

service.subject = "Test Email"
service.setRecipients Array("test@test.test")

service.performWithItems items

List of emails for sending an email message.

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


The biggest plugin in space...