Jump to content
Sign in to follow this  
bangity

Ctrl + C?

Recommended Posts

bangity

I used MouseClickDrag and dragged over a string. then i used Send("^c") to let it click Ctrl + C to put the string in the clipboard. after that, i used $a = ClipGet() but then when i try to msgbox it out. there was nothing. how is this wrong? is it ^c??

Share this post


Link to post
Share on other sites
exodius

Code please.

Share this post


Link to post
Share on other sites
bangity

ok, very simple.

"This is a string"

MouseClickDrag("left", "$x1", "$y1", "$x2", "$y2")

Send("^c")

$str = ClipGet()

just want to put the dragged string into the clipboard!

Share this post


Link to post
Share on other sites
bangity

no, what i mean is, in a website. there are many text. what i want is to start dragging from a position and drag over to the end of the text. Then put that text inside a clipboard so i can paste it into a variable for other purposes! any idea around?

Share this post


Link to post
Share on other sites
JoshDB

Your code should be working... What errors does it throw out?


Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

Share this post


Link to post
Share on other sites
bangity

it didn't say any error. the problem is there is nothing in the Clipboard after i used Send("^c")!

Share this post


Link to post
Share on other sites
bear

it didn't say any error. the problem is there is nothing in the Clipboard after i used Send("^c")!

do you use ctrl + c in ie?

i tried that by using Win32::GUITest (a perl package) SendKeys('^c');

just like your situation, nothing happended!

i also tried keybd_event function in C/C++ to simulate Ctrl + C in ie, but no result.

i don't try to use AutoIt3 to do that, but i think it will be the same.

finally, i have no choice, so i use menu command to enforce ie to copy that string.

send %ec to do that...

Share this post


Link to post
Share on other sites
bangity

what is %ec? what do you mean? i also tried to use right click and click copy after it dragged over the string., but then there was nothing in the clipboard. i really need this help please!

Share this post


Link to post
Share on other sites
Bert

I've ran into this problem also, and what I did was tried pasting it to the clipboard several times in a row with short sleep statements between. I know there are many people who say this is a bad idea, but it did fix the problem. For those who wish to slam me to the curb......

Share this post


Link to post
Share on other sites
exodius

Is there any way that you could just download the page using Inetget and parse out the part of it that you want?

Share this post


Link to post
Share on other sites
neogia

I've had some problems with the clipboard in the past, and this is what I've done:

ClipPut("")
Send("^c")
$clip = ClipGet()
While $cip == ""
    $clip = ClipGet()
WEnd

I know it's longer, but it's usually that the contents just haven't been put into the clipboard by the time AutoIt gets to the next line, and tries to read it.

Edit:Not at all. We all make typos :D

Edited by neogia

[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

Share this post


Link to post
Share on other sites
mr.underperson

Is it valid to mix quote marks like that?

-mu

Share this post


Link to post
Share on other sites
bangity

thanks a lot guys. it worked.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×