Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4    Statistic    FMM    Blog  

SharingService.ShareItems

Shares items with other services.

Component Version macOS Windows Linux Server iOS SDK
SharingService 10.3 ✅ Yes ❌ No ❌ No ❌ No ❌ No
MBS( "SharingService.ShareItems"; ServiceName; Item... )   More

Parameters

Parameter Description Example
ServiceName The service name to use.
Pass empty text to show menu at mouse cursor and let the user choose.
""
Item... Pass one parameter for each item.
An item may be a container with an image, a list of URLs, a list of native file paths or styled text.
"Hello World"

Result

Returns OK or error.

Description

Shares items with other services.
You can let the user pick the service or pass it as service name.
Pass as many parameters as needed to include all URLs, native file paths, styled text or container values with images to the function as needed.

Below a few sample service names, but there may be more installed on your computer.

NameTitle
com.apple.messages.ShareExtensionMessages
com.apple.Notes.SharingExtensionNotes
com.apple.reminders.sharingextensionReminders
com.apple.share.AirDrop.sendAirDrop
com.apple.share.Mail.composeMail
com.apple.share.System.add-to-iphotoAdd to Photos

This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.
Please repeat Item parameter as often as you need.

Examples

Share items:

# for the case you use email, we may predefine the subject & recipients we suggest
Set Variable [ $r ; Value: MBS("SharingService.SetEmailSubject"; Sharing Services::Email Subject) ]
Set Variable [ $r ; Value: MBS("SharingService.SetEmailRecipients"; Sharing Services::Email Recipients) ]
#
# set trigger
Set Variable [ $r ; Value: MBS("SharingService.SetTrigger"; Get(FileName); "Trigger") ]
#
# share them
Set Variable [ $r ; Value: MBS("SharingService.ShareItems"; Sharing Services::ServiceName;
// pass as many parameter with items. Empty ones will be ignore.
Sharing Services::URLs;
Sharing Services::Text;
Sharing Services::Image;
Sharing Services::File Paths) ]
Set Field [ Sharing Services::Result ; $r ]

Send text to Apple Mail:

MBS( "SharingService.ShareItems"; "com.apple.share.Mail.compose"; "Hello World" )

Send two URLs and some text:

MBS( "SharingService.ShareItems"; ""; "https://www.mbs-plugins.com/¶https://www.mbsplugins.eu/"; "Check the websites" )

See also

Example Databases

Blog Entries

Created 27th June 2020, last changed 5th June 2021


SharingService.SetTrigger - Shell.AddArgument

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins

Start Chat