Page 1 of 1

Copy to ClipBoard ?

Posted: Mon Dec 14, 2015 4:24 pm
by vmars316
Hello & Thanks ,

Is it possible to 'Copy to ClipBoard ?' in SB ?

Thanks...Vern

Re: Copy to ClipBoard ?

Posted: Mon Dec 14, 2015 6:17 pm
by Fred
No, it's not natively supported for now, but I bet you can still use CTRL+C from your browser ? What did you have in mind for this command ?

Re: Copy to ClipBoard ?

Posted: Tue Dec 15, 2015 11:23 am
by the.weavster
This works with Firefox and Chrome (hopefully others too):

Code: Select all

Procedure.i CopyToClipboard(txt.s)
  retval = 0
  !var x = document.createElement("TEXTAREA");
  !//styling is to prevent the element flashing on the screen
  !x.style.position = 'fixed';
  !x.style.top = 0;
  !x.style.left = 0;
  !x.style.width = '2em';
  !x.style.height = '2em';
  !x.style.padding = 0;
  !x.style.border = 'none';
  !x.style.outline = 'none';
  !x.style.boxShadow = 'none';
  !x.style.background = 'transparent';
  !x.value = v_txt;
  !document.body.appendChild(x);
  !x.select();
  !try {
    !var ok = document.execCommand('copy');
    !if(ok) { v_retval = 1; }
  !} catch(err) {
    !console.log(err.message);
  !}
  !document.body.removeChild(x);
  ProcedureReturn retval
EndProcedure

Re: Copy to ClipBoard ?

Posted: Sat Dec 26, 2015 5:13 am
by vmars316
Fred wrote:No, it's not natively supported for now, but I bet you can still use CTRL+C from your browser ? What did you have in mind for this command ?
I wrote a clipboard program ( http://www.portablefreeware.com/index.php?q=cliplog&m= ) which I am thinking about making changes to , so that it ( clipLog ) examines what is being copied . And it looks thru its cliplog.ini file to see if there is an entry for that word .
If yes , cliplog would then launch the program associated with that word .

But I wanted to know if I could copy --> clipboard with SB .
I know that I could copy from any where , but I was thinking also of a local.webpage with all the keywords as Buttons .
Anyways , just an idea .
Thanks..vm