Dalex Posted May 24, 2006 Posted May 24, 2006 I have looked for hours now with no luck, could someone please point me in the right direction. I have to copy a license key from an editbox and paste it in another field when licensing a software app. If I can get it in the clipboard I will use a Clipget() to paste it, but that is the problem I can't figure out how to get the key from the Edit1 Box onto the clipboard. I can do a ControlClick, or ControlFocus to focus on that field but after that I am lost. I tried WinGetText but I couldn't make it work, but I prob. wasn't using it correctly. The software is at work so I can't post what I have now but maybe tomorrow. [size="2"][u]Beer is living proof that God loves us and wants us to be happy.-- Ben Franklin[/u][/size]
neogia Posted May 24, 2006 Posted May 24, 2006 Try looking in the helpfile for ControlRead(). [u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia
Dalex Posted May 24, 2006 Author Posted May 24, 2006 Try looking in the helpfile for ControlRead().I can't find anything about Controlread() [size="2"][u]Beer is living proof that God loves us and wants us to be happy.-- Ben Franklin[/u][/size]
Dalex Posted May 24, 2006 Author Posted May 24, 2006 (edited) I have played with ControlGetText but no luck yet. Is it possible to use that function to read something into the clipboard? Or even read it into a varible? Or with GUICtrlRead: Edited May 24, 2006 by Dalex [size="2"][u]Beer is living proof that God loves us and wants us to be happy.-- Ben Franklin[/u][/size]
Bert Posted May 24, 2006 Posted May 24, 2006 (edited) what happens when you click on the text you want? Can you highlight it that way? If you can just click on the text you want, do this: ClipPut("") ;clears the clipboard send("^a") ;if needed, you can highlight all the text in the field. Make sure it doesn't highlight the whole screen. sleep(10) send("^c") ;copies the highlight ed text to the clipboard. Edited May 24, 2006 by vollyman The Vollatran project My blog: http://www.vollysinterestingshit.com/
Emperor Posted May 24, 2006 Posted May 24, 2006 (edited) I have played with ControlGetText but no luck yet. Is it possible to use that function to read something into the clipboard? Or even read it into a varible? Or with GUICtrlRead:; Get text from Notepad and put it into the clipboard $Var = ControlGetText("Untitled - Notepad", "", "Edit1") ClipPut($Var) Edited May 24, 2006 by Emperor
Dalex Posted May 24, 2006 Author Posted May 24, 2006 Ok figured it out, with help of a friend. This may Help someone else. I put the msgbox in there to to show that the text was copied you can remove that from the script. Then if you close the msgbox it will open note pad and enter the text just WARNING:let it finish it is kinda long but it's easier than trying to kill the script Even though the following is a WinGetText, I needed a ControlGetText (which worked the same way as the following) You can test this script by starting, it the while scite is open click Help \ About SciTE and it will run WinWaitActive("About SciTE") $text = WinGetText("About SciTE") MsgBox(0,"Text read was:", $text) ClipPut($text) Run("notepad.exe") WinWaitActive("Untitled - Notepad","") Send(ClipGet()) [size="2"][u]Beer is living proof that God loves us and wants us to be happy.-- Ben Franklin[/u][/size]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now