• <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.getText Action

Format
s = CS.Clipboard.getText();
The action does not require any arguments.
Description
The Clipboard.getText action returns text currently on the clipboard. If the clipboard contains data that cannot be represented as text, the action will not return anything.
Return Value
If text is currently on the clipboard, the action returns a string containing the text on the clipboard. If no text is on the clipboard, the action returns undefined.
Exceptions
The action does not throw exceptions.
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.putText Action