_Kurt Posted December 8, 2006 Share Posted December 8, 2006 (edited) Hey guys, I don't know why this isn't working, it's probably something very obvious that I am missing. What I want to do: Copy the highlighted text to the clipboard (mainly want to grab the highlighted text, this is just the only way I've found to do so). Send("^c") $clipget = ClipGet() If $clipget = "" Then MsgBox(0,"","No Highlighted text found") Else MsgBox(0,"","This is the text in the clipboard" & @CRLF & $clipget) EndIf This doesn't copy it to the clipboard for some reason. Ugh, I'm sure this will end up being embarrassing since I'm tired and I know I'm missing something really obvious. Thanks, Kurt Edited December 9, 2006 by _Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
mikehunt114 Posted December 8, 2006 Share Posted December 8, 2006 In your second message box (when it finds text) shouldn't the last variable be $clipget? IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
Uten Posted December 8, 2006 Share Posted December 8, 2006 Is the text selected? Send("^a") Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
_Kurt Posted December 8, 2006 Author Share Posted December 8, 2006 (edited) Sorry for the late reply. @mikehunt - Yes, I meant to put $clipget *edited first post* @Uten - I believe that CTRL + C is the proper hotkeys to copy the highlighted or selected text to the clipboard. I think that I have the proper functions and everything. I believe it may be the computer instead. I've noticed it works sometimes. Edited December 9, 2006 by _Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
Markus Posted December 8, 2006 Share Posted December 8, 2006 @Uten - I believe that CTRL + C is the proper hotkeys to copy the highlighted or selected text to the clipboard.I think, he only wanted to say, that if the text isn't selected, you could mark all by sending ctrl+a.What happens, if you use ctrl + c and ctrl + v in a text file or sth like that, just after your program tried to clipget? Does it work then? Or isn't it a autoit problem? "It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output Link to comment Share on other sites More sharing options...
Bert Posted December 8, 2006 Share Posted December 8, 2006 I've seen this before. Sometimes you need to repeat the command to get the highlighted text along with a small sleep put in. It was the only way I could solve it. The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Uten Posted December 8, 2006 Share Posted December 8, 2006 As I said is the text selected? And witch window has focus when you use send? I think your problem is that the window with the selected text does not he the focus when you run your script pice. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
_Kurt Posted December 9, 2006 Author Share Posted December 9, 2006 I will attempt to try Volly's solution once I get home to my computer. It is strange though, maybe it needs time to record the selected text to the clipboard or something? Also, Uten, that is not the case, the window does infact have focus when I try to copy it. I wonder if there is any other way to record highlighted/selected text. Any ideas since the copy/clipget isn`t working? Thanks, Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
Rick Posted December 9, 2006 Share Posted December 9, 2006 (edited) its because sometimes it takes a while for the data to goto to the clipboard (ie: emptying and refilling) so the answer is put in a delay until clipboard has something such as.......... While StringLen(ClipGet()) = 0 Sleep(50) Wend then it always works. hope that helped Edited December 9, 2006 by Rick Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
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