clipboard

Send Text to other Applications

 ̄綄美尐妖づ 提交于 2019-12-11 11:47:12
问题 I have a string variable. Now i want to store a string value into a control in another application without using the clipboard. I wanna do it manually. I think i should use SendMessage(WM_SETTEXT). Which way do you suggest (with an example please)? 回答1: As your application knows the string it has to send... You can set the focus to the target window/application if needed. Then you process each char contained in your string to simulate their key strokes. Something like that (too basic to work

Clear contents of a WorkSheet using macro, without clearing the clipboard

徘徊边缘 提交于 2019-12-11 10:48:42
问题 How do I clear the contents of a excel sheet using macro, without clearing the contents of the clipboard? I am currently using the below code(which is called by clicking a button on the sheet), but this clears the data in the clipboard, which I have copied from other source, and want to paste in the cleared sheet Sub clearly() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets ws.UsedRange.ClearContents Next ws End Sub 回答1: which I have copied from other source, and want to paste in

How to Copy to Clipboard in JavaScript and make it HTML?

谁说我不能喝 提交于 2019-12-11 08:52:49
问题 I found some nice solutions here on how to copy text in JavaScript to the clipboard in: How do I copy to the clipboard in JavaScript? But is there any way to give it a type? Want I want is to paste to clipboard something like: this is < b >bold< /b > and when pasting it into OpenOffice or Word, get this is bold 回答1: You could just manipulate the string the user selects before sending it to the clipboard. Refer the answer for this question which shows how a string manipulation could be done

How to make KnokoutJS and ClipboardJS work together?

只愿长相守 提交于 2019-12-11 08:51:40
问题 I try to copy to clipboard some information from Knockout foreach: <tbody data-bind="foreach: selections"> <tr> <td> <a href="#" class="copy_btn" data-bind="attr: { 'data-clipboard-text' : name}"><i class="fa fa-copy"></i></a> </td> </tr> </tbody> with ClipboardJS: var btns = document.querySelectorAll('a.copy_btn'); var clipboard = new Clipboard(btns); clipboard.on('success', function (e) { console.log(e); }); clipboard.on('error', function (e) { console.log(e); }); But it's not copying. What

How to use the clipboard in Go?

左心房为你撑大大i 提交于 2019-12-11 08:11:12
问题 How can I copy to the clipboard, or get data from it, using Go? I'm a bit concerned that there are no results in the documentation and Google has yielded me this result, but I want this to work cross-platform... then I found this playground snippet (from that page) but it doesn't compile (because the "unsafe" package can't be used in the playground, I get this, but it still looks platform-dependent). So is this even possible, cross-platform? 回答1: You'll have to os.exec(..) out to the platform

How to pass a value between browser tabs?

一曲冷凌霜 提交于 2019-12-11 07:36:10
问题 I am trying to pass a value from one tab to another. I tried sessionStorage and clipboard, but no luck so far. Here is the demo, and the code as well: https://builder.addons.mozilla.org/package/154290/latest/ What it tries to do is get the selected text, and pass it to the opened tab: // Create a new context menu item. var menuItem = contextMenu.Item({ label: "Check with Proofread Bot", context: contextMenu.SelectionContext(), contentScript: 'self.on("click", function () {' + ' var text =

Autohotkey : Clipboard Convert Tabs to Spaces

心已入冬 提交于 2019-12-11 06:57:08
问题 I have a snippet of code I copied into my clipboard. Pasting it out looks like this. Where[tab] is an actual tab indent [tab]<header id="masthead" class="site-header"> [tab][tab]<h1> [tab][tab][tab]<h2> [tab][tab][tab][tab]<h3> [tab][tab][tab][tab][tab]<h4>; I want to press an autohotkey to automatically normalize the code snippet. So if there's a [tab] on every line, remove it. Then convert each [tab] into 2 spaces [**] <header id="masthead" class="site-header"> **<h1> ****<h2> ******<h3> **

Listening on system clipboard using JavaFx

岁酱吖の 提交于 2019-12-11 06:28:50
问题 As stated in the answer to this question, one can setup a Timeline to check whether there is a change in the system clipboard: Set and use variables outside timeline in javafx 8 But is there a better way? For example, an event listener? I have searched JavaFx 8 doc and didn't find anything obviously helpful. Solutions using JavaFx is preferred, but all answers are welcome. 回答1: import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.input.Clipboard; import javafx

DragQueryFile returns 0 when I try to get file count?

女生的网名这么多〃 提交于 2019-12-11 06:24:21
问题 I am trying to fetch a list of copied files from the clipboard. I am well-aware that WPF has inbuilt methods for this, but it is important for me to use the API, since WPF's implementation of the clipboard is buggy, as described many places on the web. So far I am using the GetClipboardData function which returns a pointer to the data I need in the memory. Now, to enumerate through this data, I figured out that I need to use the DragQueryFile API in Windows. My DragQueryFile API is declared

Firefox webextension not copying to clipboard

核能气质少年 提交于 2019-12-11 05:57:25
问题 I have a Firefox web extension which is supposed to generate buttons which copy a link to the clipboard. In my content script for the plugin, I have: button.onclick = function() { var link = window.location.href.replace(/#[0-9a-zA-Z_]+$/, '') + '#' + id; var txtToCopy = document.createElement('input'); txtToCopy.value = link; txtToCopy.select(); console.log(txtToCopy.value); var res = document.execCommand('copy'); console.log(res); } As you can see, I have it logging the value I'm trying to