Author Topic: Copy File Contents to Clipboard  (Read 4823 times)

Benjamin Dasari

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 95
    • View Profile
Copy File Contents to Clipboard
« on: April 28, 2016, 03:23:39 PM »
Purpose:
To copy the contents of a text file to the clipboard by executing a function on UIEvent/s.


Liquid UI Code:

// SAPLSMTR_NAVIGATION.E0100.sjs
// User Interface - SAP Easy Access Screen
pushbutton([TOOLBAR],'Copy to Clipboard', '?', {'process':copyClipBoard,'size':[1,20]})

// Copies the contents of the file to the clipboard
// Need to have webscript.dll v175 or later
function copyClipBoard() {
   // Examples:
   // system.ShellExecute('iexplore.exe','http://www.guixt.com');                       // Opens Web Browser with specified link
   // system.ShellExecute('notepad.exe');                                                            // Opens Notepad
   // system.ShellExecute('notepad.exe', 'C:\\guixt\\scripts\\filename.txt');      // Opens Specified File in Notepad
   system.ShellExecute('cmd.exe', '/C type c:\\guixt\\scripts\\test.txt|clip');
}


See attachments for code samples!
« Last Edit: May 24, 2018, 05:18:40 PM by Benjamin Dasari »