copy-paste

Copy-paste using Capybara?

不问归期 提交于 2019-12-11 12:53:20
问题 I would love to do something like this: div = find '#some-div' copy_to_clipboard(div) input = find '#my-input' paste_from_clipboard(input) I do not want to simulate this with send_keys and using Ctrl+C and Ctrl+V; I want this to work cross-browser (especially on mobile). Does this API exist? 回答1: There is no Capybara copy/paste API - If all you want to do is copy the visible text into an input then you could do div_text = find('#some-div').text() find('#my-input').set(div_text) If that's not

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

QTreeview with my model how to implement copy paste operation

扶醉桌前 提交于 2019-12-11 09:51:07
问题 I want to implement copy and paste operation in my QTreeView against my context menu copy and paste I have subclass QAbstractItemModel. I have Treeview Say Four Tope level items and each of them are having multiple child Top Item1 ---------- Child1 Child11 Child111 Top Item2 ---------- Top Item3 I want to right on click item "child1" and copy child1 and all its child up to child111 and then right click and paste on "Top Item3" so that all items from child1 to child111 is copied under Top

Copy paste via notification bar in Android

送分小仙女□ 提交于 2019-12-11 09:38:41
问题 Have you seen these password managers like Lastpass ? They allow you to copy-paste via Notification bar in Android. Typically, the sequence is like this.. User in Lastpass presses a button, that puts two notifications in Notification Bar. User switches to any other application say a browser and when he has to insert username and password He opens notification bar, selecting the notifications from Lastpass pastes the username or password into the textfield of the browser. Can anyone break this

awk only works on copied data, why?

风流意气都作罢 提交于 2019-12-11 09:29:14
问题 I have a somewhat straightforward awk used for the purpose described here: Append multiple header information fields to file until next header found The awk only works on the data after I copy/paste it into a new file. If I direct the output of head into a new file, the awk still does not work, for instance. The awk only works if I copy/paste the file into a new file. `head -40 file.csv > output.csv` This is the awk: `awk -F, '/"Serial No."/ {sn = $2} /"Location:"/ {loc = $2} /"([0-9]{1,2}\/)

copy & paste a picture from one sheet to another

假如想象 提交于 2019-12-11 08:36:07
问题 I created a small program using the following code to transfer a picture from one sheet to another in the same workbook. Sub transferPicturesPAPER_EXAM(pictureNo As Long, p As Integer, srcSht As String, dstSht As String, insertWhere As String) ' Transfers the selected Picture to the exam sheet. ''zxx If pictureNo = 0 Then Exit Sub Sheets(srcSht).Select ActiveSheet.Unprotect ActiveSheet.pictures("Picture " & pictureNo).Select 'ActiveSheet.Shapes.Range(Array("Picture " & pictureNo)).Select

Copy Range From One Sheet Paste Part of Range In Same Sheet Based On Cell Value On Another Sheet

﹥>﹥吖頭↗ 提交于 2019-12-11 08:23:13
问题 Right now I've created a code to copy values from one range to another range based on the value from another sheet (the copy and paste happens on one sheet). But because this value can be one of twelve values, the range that is being copied and pasted becomes smaller. Because I'm not adept at VBA I created dozens of copy ranges and dozens of paste ranges in Excel to handle ElseIf statements via VBA to copy and paste depending on what the cell value is in the other sheet. I'm curious, is there

Python - copying specific files from a list into a new folder

你。 提交于 2019-12-11 08:13:11
问题 I am trying to get my program to read a list of names from a file (say .txt), then search for those in a selected folder and copy and paste those files to another selected folder. My program runs without errors but does not do anything: Code - updated: import os, shutil from tkinter import filedialog from tkinter import * root = Tk() root.withdraw() filePath = filedialog.askopenfilename() folderPath = filedialog.askdirectory() destination = filedialog.askdirectory() filesToFind = [] with open

Copy-Paste Items in Petrel using Ocean…?

我怕爱的太早我们不能终老 提交于 2019-12-11 08:09:56
问题 In Petrel, is it possible to COPY-PASTE items in input tree using ocean? I need to have a copy of a specific well or strategy somewhere; how can I do this? For example if I want to have a copy of this well (myWell): Tubing = e.Data.GetData(typeof(TubingString)) as TubingString; Borehole myWell=Tubing.Borehole; into my boreholecollection (Borhol): WellRoot Welrot = Slb.Ocean.Petrel.DomainObject.Well.WellRoot.Get(PetrelProject.PrimaryProject); BoreholeCollection Borhol = Welrot

Detecting a paste into a RichTextBox

时光总嘲笑我的痴心妄想 提交于 2019-12-11 07:28:36
问题 Is there some way I can detect or cause an event to fire whenever text is pasted into a RichTextBox? Or maybe there is already some kind of event that fires when text is pasted? This is Winforms C#, by the way. 回答1: Because not all people may use Ctrl+V and because there are other ways to get text into a text box (such as drag and drop), I went a different route, which I will share here in case anyone else is looking for a solution. What I did was create a field in my class: int _lastPosition