Questions tagged [clipboard]

The clipboard is a software facility that can be used for short-term data storage and/or data transfer between documents or applications, via copy and paste operations.

clipboard
Filter by
Sorted by
Tagged with
4346 votes
27 answers
2.9m views

How do I copy to the clipboard in JavaScript?

How do I copy text to the clipboard (multi-browser)? Related: How does Trello access the user's clipboard?
Santiago Corredoira's user avatar
1300 votes
31 answers
810k views

Pipe to/from the clipboard in a Bash script

Is it possible to pipe to/from the clipboard in Bash? Whether it is piping to/from a device handle or using an auxiliary application, I can't find anything. For example, if /dev/clip was a device ...
moinudin's user avatar
  • 136k
1106 votes
40 answers
930k views

How to copy to clipboard in Vim?

Is it possible to copy to clipboard directly from Vim? yy only copies stuff to Vim's internal buffer. I want to copy to the OS's clipboard. Is there any such command in Vim or you can only yank stuff ...
Hari Menon's user avatar
  • 34.5k
1102 votes
38 answers
1.1m views

How can I make Vim paste from (and copy to) the system's clipboard?

Unlike other editors, Vim stores copied text in its own clipboard. So, it's very hard for me to copy some text from a webpage and paste it into the current working file. It so happens I have to either ...
Santosh Kumar's user avatar
958 votes
5 answers
147k views

How does Trello access the user's clipboard?

When you hover over a card in Trello and press Ctrl+C, the URL of this card is copied to the clipboard. How do they do this? As far as I can tell, there is no Flash movie involved. I've got ...
Boldewyn's user avatar
  • 82k
845 votes
25 answers
696k views

How can I copy the output of a command directly into my clipboard?

How can I pipe the output of a command into my clipboard and paste it back when using a terminal? For instance: cat file | clipboard
Legend's user avatar
  • 115k
564 votes
10 answers
526k views

How to copy data to clipboard in C#

How can I copy a string (e.g "hello") to the System Clipboard in C#, so next time I press CTRL+V I'll get "hello"?
aharon's user avatar
  • 7,473
479 votes
31 answers
593k views

In reactJS, how to copy text to clipboard?

I'm using ReactJS and when a user clicks a link I want to copy some text to the clipboard. I am using Chrome 52 and I do not need to support any other browsers. I can't see why this code does not ...
Duke Dougal's user avatar
  • 25.3k
466 votes
32 answers
297k views

How to Copy Text to Clipboard in Android?

Can anybody please tell me how to copy the text present in a particular textview to clipboard when a button is pressed? @Override protected void onCreate(Bundle savedInstanceState) { super....
Darshan Gowda's user avatar
380 votes
23 answers
491k views

JavaScript get clipboard data on paste event (Cross browser)

How can a web application detect a paste event and retrieve the data to be pasted? I would like to remove HTML content before the text is pasted into a rich text editor. Cleaning the text after ...
Alex's user avatar
  • 12.3k
306 votes
8 answers
223k views

How do I copy the contents of a String to the clipboard in C#? [duplicate]

If I have some text in a String, how can I copy that to the clipboard so that the user can paste it into another window (for example, from my application to Notepad)?
Elie's user avatar
  • 13.8k
298 votes
8 answers
466k views

Python script to copy text to clipboard [duplicate]

I just need a python script that copies text to the clipboard. After the script gets executed i need the output of the text to be pasted to another source. Is it possible to write a python script ...
iamsiva11's user avatar
  • 3,109
284 votes
30 answers
255k views

How do I copy a string to the clipboard?

I'm trying to make a basic Windows application that builds a string out of user input and then adds it to the clipboard. How do I copy a string to the clipboard using Python?
tester's user avatar
  • 22.8k
263 votes
16 answers
76k views

Yank file name / path of current buffer in Vim

Assuming the current buffer is a file open for edit, so :e does not display E32: No file name. I would like to yank one or all of: The file name exactly as show on the status line, e.g. ~\myfile....
davetapley's user avatar
  • 17.5k
236 votes
28 answers
143k views

How to copy a selection to the OS X clipboard

I have an area selected in Vim. How can I copy it into the OS X clipboard? (The OS X clipboard can be written to via a pipe to /usr/bin/pbcopy)
ʞɔıu's user avatar
  • 47.8k
234 votes
15 answers
126k views

How to send data to local clipboard from a remote SSH session

Most Unix-like systems have a command that will let you pipe/redirect output to the local clipboard/pasteboard, and retrieve from same. On OS X, these commands are pbcopy, pbpaste Is there a way to ...
Alana Storm's user avatar
216 votes
2 answers
78k views

Copy text to clipboard with iOS

What is the best way to copy text to the iPhone's clipboard in your application? Their docs are sketchy and have way more features than what I want... I just want to set a string as the users ...
tarnfeld's user avatar
  • 26.3k
193 votes
7 answers
160k views

Copying text to the clipboard using Java

I want to copy text from a JTable's cell to the clipboard, making it available to be pasted into other programs such as Microsoft Word. I have the text from the JTable, but I am unsure how to copy it ...
user765134's user avatar
  • 1,933
193 votes
1 answer
277k views

How to copy text to the client's clipboard using jQuery? [duplicate]

The workflow is simple: You click inside a textarea. The text is copied to the client's clipboard. Display notice to the user. How do you do it?
mager's user avatar
  • 4,825
191 votes
8 answers
187k views

navigator.clipboard is undefined

Why is navigator.clipboard always undefined in the following snippet? var clipboard = navigator.clipboard; if (clipboard == undefined) { console.log('clipboard is undefined'); } else { ...
drmrbrewer's user avatar
  • 12.1k
181 votes
2 answers
88k views

Secret copy to clipboard JavaScript function in Chrome and Firefox?

Update Looks like browsers are starting to support copy natively in JS In the console windows of both Chrome and Firefox on Mac I can execute copy("party in your clipboard!"); and the text gets ...
Mike Grace's user avatar
  • 16.8k
180 votes
25 answers
123k views

Copy paste text into iOS simulator

This must be documented somewhere, but I can't find it. In my app using the iPad simulator there is a textfield into which I want the user to paste text. In the real world the user will copy the text ...
zerowords's user avatar
  • 3,013
175 votes
13 answers
385k views

Copying a rsa public key to clipboard

I am trying to copy a public key to the clipboard on macOS, but I keep getting "no such file or directory." The command I am using is pasted below pbcopy < ~/.ssh/id_rsa.pub
user1850254's user avatar
  • 2,271
173 votes
3 answers
41k views

How do I capture bash output to the Mac OS X clipboard?

Is it possible to capture bash output to the OS X clipboard?
Stephen Handley's user avatar
167 votes
4 answers
308k views

Get current clipboard content? [closed]

I'd like to know a way to make my script detect the content of the clipboard and paste it into a text field when the page is opened, with no input from the user. How can it be done?
kettlepot's user avatar
  • 10.8k
165 votes
11 answers
116k views

Copy to clipboard in Node.js?

Is there a way you can copy to clipboard in Node.js? Any modules or ideas what so ever? I'm using Node.js on a desktop application. Hopefully that clears up why I want it to be able to achieve this.
Tower's user avatar
  • 101k
157 votes
15 answers
193k views

How do I read text from the Windows clipboard in Python?

How do I read text from the (windows) clipboard with python?
Foo42's user avatar
  • 3,114
149 votes
13 answers
103k views

Yank entire file

I often write something in gVim, then need to copy-paste it into another application. Is there an easy way to yank the entire file? I usually do something like this ggVG"+y (Go to top, visual-line ...
Chad Birch's user avatar
  • 73.8k
124 votes
13 answers
62k views

The function to show current file's full path in mini buffer

I need to get the full path of the file that I'm editing with emacs. Is there a function for that? If not, what would be the elisp function for getting that? How can I copy the result (path name) to ...
prosseek's user avatar
  • 186k
119 votes
16 answers
174k views

Leave out quotes when copying from cell

Problem: When copying a cell from Excel outside of the program, double-quotes are added automatically. Details: I'm using Excel 2007 on a Windows 7 machine. If I have a cell with the following ...
Aaron Thomas's user avatar
  • 5,112
115 votes
19 answers
133k views

Copy / Put text on the clipboard with FireFox, Safari and Chrome

In Internet Explorer I can use the clipboardData object to access the clipboard. How can I do that in FireFox, Safari and/or Chrome?
GvS's user avatar
  • 52.2k
113 votes
8 answers
60k views

How to add extra info to copied web text

Some websites now use a JavaScript service from Tynt that appends text to copied content. If you copy text from a site using this and then paste you get a link to the original content at the bottom ...
Keith's user avatar
  • 152k
110 votes
11 answers
180k views

Copy output of a JavaScript variable to the clipboard

I have no knowledge of JavaScript, but I managed to put this code together using bits and bolts from various Stack Overflow answers. It works OK, and it outputs an array of all selected ...
harman's user avatar
  • 1,685
110 votes
6 answers
119k views

Paste an image from clipboard using JavaScript [duplicate]

How do we paste an image from clipboard into a custom rich text editor using javascript? (ctrl+c and ctrl+v or a snapshot). Has anyone used Ajax's rich text editor? Does pasting an image from ...
kani's user avatar
  • 1,099
108 votes
4 answers
26k views

What exactly is "label" parameter in ClipData in Android?

According to the Android documentation, ClipData use "label" as a kind of representation to the copied data. ClippedData is a complex type containing one or Item instances, each of which can hold ...
hackjutsu's user avatar
  • 8,584
105 votes
9 answers
88k views

How to make copyable Text Widget in Flutter?

When long tab on Text widget, a tooltip show up with 'copy'. When click on the 'copy' the text content should copy to system clipboard. The following will copy the text on long tap, but does not show ...
Kyaw Tun's user avatar
  • 12.8k
101 votes
10 answers
83k views

How do I monitor clipboard changes in C#?

Is there a clipboard changed or updated event that i can access through C#?
Sevki's user avatar
  • 3,642
94 votes
1 answer
39k views

What is difference between Vim's clipboard "unnamed" and "unnamedplus" settings?

What is the difference between these 2 settings? set clipboard=unnamed set clipboard=unnamedplus Which one should I use in order to have multi-platform .vimrc?
syntagma's user avatar
  • 23.8k
92 votes
14 answers
116k views

Copy to clipboard using Javascript in iOS

I'm using this function to copy a URL to the clipboard: function CopyUrl($this){ var querySelector = $this.next().attr("id"); var emailLink = document.querySelector("#"+querySelector); var ...
Nino Amisulashvili's user avatar
92 votes
13 answers
87k views

How do I copy and paste data into R from the clipboard?

I have my data open in another application (e.g. a spreadsheet, like Excel, or a text editor). If I copy that data to my operating system clipboard, how can I read it into R as a data.frame?
Moderat's user avatar
  • 1,522
92 votes
8 answers
84k views

Copy to clipboard without Flash

I found many solutions for copying to the clipboard, but they all either with flash, or for websites side. I'm looking for method copy to clipboard automatically, without flash and for user side, it's ...
Black_Sun's user avatar
  • 921
90 votes
4 answers
34k views

Clipboard API call throws NotAllowedError without invoking onPermissionRequest()

I have a simple page with a button, that when pressed, uses the Async Clipboard API to write to the clipboard. <body> <button type="button" onclick="testClipboard();">...
cyqsimon's user avatar
  • 3,154
88 votes
13 answers
66k views

OpenClipboard failed when copy pasting data from WPF DataGrid

I've got a WPF application using datagrid. The application worked fine until I installed Visual Studio 2012 and Blend+SketchFlow preview. Now, when I'm trying to copy the data from the grid ...
Arsen Zahray's user avatar
  • 24.8k
83 votes
5 answers
102k views

Copying to the clipboard in Java [duplicate]

I want to set the user's clipboard to a string in a Java console application. Any ideas?
clone1018's user avatar
  • 1,247
79 votes
15 answers
107k views

DOMException on calling navigator.clipboard.readText()

Following lines of code used to work and stopped working after chrome upgrade to Version 74.0.3729.169 (Official Build) (64-bit). Now I get DOMException even though permission is set correctly. ...
frosty's user avatar
  • 2,611
75 votes
9 answers
50k views

How can I copy rich text contents to the clipboard with JavaScript?

Premise I need help copying rich text to the clipboard using JavaScript. I have searched around and haven't found anything to suit my specific needs. Code function ctrlA1(corp) { with(corp) {...
marv's user avatar
  • 1,048
74 votes
6 answers
41k views

.Net Core - copy to clipboard?

Is it possible to copy something to the clipboard using .Net Core (in a platform-agnostic way)? It seems that the Clipboard class is missing, and P/Invoking isn't an option outside of Windows. Edit: ...
Matt Thomas's user avatar
  • 5,498
73 votes
13 answers
86k views

How can you get the clipboard contents with a Windows command?

For example, I can copy a file to the clipboard like this: clip < file.txt (Now the contents of file.txt is in the clipboard.) How can I do the opposite: ???? > file.txt So that the ...
Matt's user avatar
  • 21.5k
72 votes
6 answers
73k views

Javascript - Copy string to clipboard as text/html

Is there a way in javascript to copy an html string (ie <b>xx<b>) into the clipboard as text/html, so that it can then be pasted into for example a gmail message with the formatting (ie, ...
kofifus's user avatar
  • 18.2k
70 votes
3 answers
51k views

Get readable text only from clipboard

I already know how to get plain text from the clipboard in Java, but sometimes the text is encoded in some weird DataFlavor, like when copying from Microsoft Word or from a website or even source code ...
clamp's user avatar
  • 33.5k

1
2 3 4 5
83