Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: ShellExecute(), pushbutton()
Purpose
This article guides the process of copying the content from a text file to the clipboard using the ShellExecute command. Here, we’ll consider the SAP Easy Access screen as an example and walk you through the following steps:
- Delete the image container on the SAP Easy Access screen.
- Add a toolbar push button to initiate the copy operation.
- Add a function to copy the contents to the clipboard.
User Interface
//Create this file inside your script folder for customizing the SAP Easy Access screen. SAPLSMTR_NAVIGATION.E0100.sjs
//Now, let's add the Liquid UI script to the above file and save it.
Customization
- Delete the image container on the SAP Easy Access screen using del().
// Deletes the image container del("X[IMAGE_CONTAINER]");
- Add a toolbar push button labeled Copy to Clipboard to execute the function copyClipBoard on click.
// Creates a toolbar push button labeled Copy to Clipboard pushbutton([TOOLBAR],'Copy to Clipboard','?',{'process':copyClipBoard,'size':[1,20]})
- Add a function to copy the contents to the clipboard.
// Function to copy the text to the clipboard
function copyClipBoard() { system.ShellExecute('cmd.exe','/C type C:\LiquidUI\scripts\file.txt|clip'); }
SAP Process
- Refresh the SAP screen and click the Copy to Clipboard push button to copy the content to the clipboard. Press the Windows key + V to view the copied content.