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: 12.0   12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3    Statistic    FMM    Blog  


Adds text to the clipboard.

Component Version macOS Windows Linux Server iOS SDK
Clipboard 13.2 ✅ Yes ❌ No ❌ No ❌ No ❌ No
MBS( "Clipboard.AddText"; text; type )   More


Parameter Description Example
text The new txt for the clipboard. "Hello World"
type The data type.
By default NSStringPboardType, but can be other Mac types.


Returns OK or error.


Adds text to the clipboard.
This function allows on macOS to put multiple things on the clipboard, like both a text representation and a xml one.
So if user pastes to a text editor, they get the text editor, but if they paste into your app, you can get back the xml.


Add two text things and query back:

# set
Set Variable [ $r ; Value: MBS( "Clipboard.SetText"; "Hello World" ) ]
Set Variable [ $r ; Value: MBS( "Clipboard.AddText"; "{\"text\": \"Hello World\", \"RowID\": 123 }"; "JSON" ) ]
# query
Set Variable [ $$json ; Value: MBS( "Clipboard.GetText"; "JSON") ]
Set Variable [ $$text ; Value: MBS( "Clipboard.GetText"; "") ]

Add both xml and text to clipbord:

# put script step on clipboard
Set Variable [ $r ; Value: MBS( "Clipboard.SetFileMakerData"; "auto"; "<fmxmlsnippet type=\"FMObjectList\"><Step enable=\"True\" id=\"62\" name=\"Pause/Resume Script\"><PauseTime value=\"ForDuration\"></PauseTime><Calculation><![CDATA[1]]></Calculation></Step></fmxmlsnippet>" ) ]
# and a text for Text editors
Set Variable [ $r ; Value: MBS( "Clipboard.AddText"; "Pause/Resume Script [ Duration (seconds): 1 ]"; "" ) ]
# now you can paste in code editor

See also

Release notes

Blog Entries

This function does not need a paid license.

Created 15th April 2023, last changed 16th April 2023

ClearRegistration - Clipboard.DetectFileMakerDataType

💬 Ask a question or report a problem

Start Chat