• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
      • Overview
      • Execution Environments
      • Security and Formatting Options
      • Base Actions
      • Application Namespace
      • Clipboard Namespace
        • Clipboard Action Invoker Namespace
        • Clipboard.getText Action
        • Clipboard.putText Action
      • Data Namespace
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • Logic Namespace
      • Message Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • System Namespace
      • UI Namespace
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Clipboard.putText Action

Format
CS.Clipboard.putText(text := ...)
ArgumentDescriptionTypes / Required
textThe text to put onto the clipboard.string, number
required
Description
The Clipboard.putText action puts text onto the clipboard. The text will be available to other applications, or from within CSPro using the Clipboard.getText action.
On Android, for security reasons, the text copied to the clipboard is temporarily shown to the user.
Return Value
The action returns undefined.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form. On Android, the action throws an exception if there is an error accessing the clipboard.
Example (CSPro Logic)
string clipboardText = CS.Clipboard.getText();

if clipboardText = "" then
    clipboardText = 
"<There was no text on the clipboard.>";
endif;

clipboardText = 
maketext("Clipboard text modified by CSPro at %s: %s", timestring(), clipboardText);

CS.Clipboard.putText(text := clipboardText);
Example (JavaScript)
let clipboardText = CS.Clipboard.getText();

if( clipboardText === undefined ) {
    clipboardText = 
"<There was no text on the clipboard.>";
}

clipboardText = 
"Clipboard text modified by CSPro at " +
               
new Date().toString() + ": " +
                clipboardText;

CS.Clipboard.putText({
    text: clipboardText
});
See also: Clipboard Action Invoker Namespace, Clipboard.getText Action