Jump to content
Sign in to follow this  
johngu

Trouble issuing ctrl+c to copy text

Recommended Posts

johngu

I wrote a very simple script to attempt to copy text from an open notepad (with text in it). While the ctrl+a seems to be received correctly (I see all the text in the notepad highlighted), no text is copied to the clipboard (when I issue ctrl+v by hand, nothing is pasted). Any thoughts? Sorry if this is a very newbie question - it just seems weird. Also, I don't want to use the GetText command because ctrl-c works with more control types, which is ultimately my goal. Thanks in advance for the help.

$title = "Untitled - Notepad"

Sleep(100)

ControlSend($title, "", 15, "^a")

Sleep(100)

ControlSend($title, "", 15, "^c")

Sleep(100)

Share this post


Link to post
Share on other sites
Thatsgreat2345

Try increasing the sleep delay between the select all and the copy and so on :P by the way what is this for?

Edited by Thatsgreat2345

Share this post


Link to post
Share on other sites
johngu

Tried increasing the delays to 1000 ms. Still doesn't work. This is for reading text out of a game's custom control. When I issue ctrl-c normally, this works. But does not through AutoIt. So I tried on a simpler example...

Share this post


Link to post
Share on other sites
Thatsgreat2345

I increased it to 500 in between the control a and control c, with notepad it worked. Does this game happen to have gameguard, or other game hacking prevention integrated?

Share this post


Link to post
Share on other sites
ame1011

$text = WinGetText("Untitled - Notepad", "")
MsgBox(0, "Text read was:", $text)


[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.