Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Action code to clear the clipboard (Read 2670 times)
Sumner Gerard
Full Member
*
Offline



Posts: 359

Action code to clear the clipboard
Sep 27th, 2012, 3:31pm
 
I want a Stamp I can apply to clear the clipboard. After a search I found this:

Code:
echo -n '' | pbcopy 



That works well from the command line on my system.

BUT the following does not work as expected:

Code:
runCommand("echo -n '' | pbcopy") 



That clears everything and leaves "-n"  and a trailing newline character in the clipboard.

If I remove the -n option, the clipboard clears but the trailing newline character remains, as expected per man echo.

I've tried escaping, switching single and double quotes, putting the string in a code note, etc. not really knowing what I'm doing but figuring no harm in trying. But I can't get it to work. runCommand() seems just too smart (or confused?) in this case, or maybe it just doesn't support the -n option.

Would appreciate help! ... If there's a more runCommand()-friendly approach than this particular one, that would be fine too.


Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Action code to clear the clipboard
Reply #1 - Sep 27th, 2012, 4:29pm
 
Try the stamp action:

runCommand("pbcopy < /dev/null")

Found via Google, here. Tests OK for me in TB v5.11.2.
Back to top
 
« Last Edit: Sep 27th, 2012, 4:29pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Sumner Gerard
Full Member
*
Offline



Posts: 359

Re: Action code to clear the clipboard
Reply #2 - Sep 27th, 2012, 4:53pm
 
Yes, that works nicely. Thanks!
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print