Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Clipboard.SetRTFText
Puts RTF data on the clipboard.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Clipboard | 5.0 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |
MBS( "Clipboard.SetRTFText"; RTFText { ; Encoding } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
RTFText | The RTF data to put in clipboard. | "{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 \cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural \f0\b\fs28 \cf0 Hello World}" |
|
Encoding | The text encoding for text parameter. Default is Windows ANSI. Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ. |
UTF8 | Optional |
Result
Returns OK or error.
Description
Puts RTF data on the clipboard.See also Text.TextToRTF to convert formatted text to RTF.
For server this will modify the clipboard of the user account running the server app on the server computer and not the clipboard of any client.
On Windows you may want to use Text.ReplaceNewline first to convert line endings. FileMaker on Windows uses Mac line endings internally.
Examples
Put text on clipboard:
MBS( "Clipboard.SetRTFText"; "{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\b\fs28 \cf0 Hello World}"; "UTF8" )
Put HTML on the clipboard via RTF:
Set Variable [ $r ; Value: MBS( "RichText.ReadHTML"; Assets::Description; "utf-8" ) ]
Set Variable [ $r ; Value: MBS( "Clipboard.SetRTFText"; MBS( "RichText.RTF" )) ]
See also
- Clipboard.GetHTMLText
- Clipboard.GetRTFText
- Clipboard.GetText
- Clipboard.SetHTMLText
- Clipboard.SetStyledText
- Clipboard.SetText
- RichText.ReadHTML
- RichText.RTF
- Text.ReplaceNewline
- Text.TextToRTF
Example Databases
This function checks for a license.
Created 17th November 2014, last changed 16th December 2022