« MBS FileMaker Plugin,… | Home | Shortcuts for formula… »

Create an email in Apple Mail from FileMaker

Did you know we can pass styled text to Apple Mail?

We can use our SharingService functions to share data with other applications. This includes passing styled text, containers with images, files or URLs.

Available services

Using the SharingService.ServicesForItems function, we can query the available services to request. This allows us to check which services are available and only show a button to share via Airdrop, if that is possible.

By default you have these services available on macOS:

TitleNameTextFile PathImagesURLs
Add to Photoscom.apple.share.System.add-to-iphoto-XX-
Add to Reading Listcom.apple.share.System.add-to-safari-reading-list---X
AirDropcom.apple.share.AirDrop.send-XXX
Dropbox Transfercom.getdropbox.dropbox.TransferExtension-XX-
Freeformcom.apple.freeform.sharingextensionXXXX
Mailcom.apple.share.Mail.composeXXXX
Messagescom.apple.share.Messages.windowXXXX
Notescom.apple.Notes.SharingExtensionXXXX
Reminderscom.apple.reminders.sharingextensionXXXX
Simulatorcom.apple.iphonesimulator.ShareExtension-XXX

If you install applications, they may offer additional services. I got Dropbox to show up here, so I included it in the table.

Send Email

Now let's send an email by sharing some text and a container with an image. The image on the right shows the Apple Mail window with styled text, but without an image.

If you don't pick a service like com.apple.share.Mail.compose, we show a menu with the plugin to pick one. For sending emails, we can pass recipients and subject lines for the email.

# for the case you use email, we may predefine the subject & recipients we suggest

Set Variable [ $r ; Value: MBS("SharingService.SetEmailSubject"; "Hello") ]
Set Variable [ $r ; Value: MBS("SharingService.SetEmailRecipients"; "test@tester.test") ]

# share them

Set Variable [ $r ; Value: MBS("SharingService.ShareItems";
    "com.apple.share.Mail.compose";
    "Dear client¶¶Hello World!";
    Test::Image) ]
Set Field [ Test::Result ; $r ]

If you like to try this, please use MBS Plugin in version 15.3 with a few bug fixes in that direction. In Apple Mail, you may need to make sure the setting for new emails is set to rich text.

Claris FileMaker Plugin
02 06 25 - 07:38