Jump to content
Sign in to follow this  
nAutoIT

Send("^c") and _ClipBoard_GetData()

Recommended Posts

nAutoIT

#Include <Clipboard.au3>

Mouseclick("left", 100, 200, 1)

Send("^c")

$chatraw = _ClipBoard_GetData($CF_TEXT)

I try to extract Chat out of a Chatwindow. Single Letters of this Chat cant be highlighted (also Au3Info doesnt get any Information from this Window), but you can click on a line of Text and use ctrl+c to get it into the ClipBoard and paste it in a Textfile, for example. If i run the above Script, it stops and i get a Windows Error Message.

The copied text is something like this(Without the "): "[@A]4:25 PM [b"]Brand[/b"]: test"

Not sure if my Explanation was clear, so here is what i want the Script to do:

1.) Click somewhere on the screen.

2.) Hit ctrl+c

3.) Paste into a string/text-file/msgbox

If i do this manually, it works, but i cant get AutoIt to do it.

Share this post


Link to post
Share on other sites
nAutoIT

Thanks for the fast answer, JohnOne.

I just tried this:

#Include <Clipboard.au3>

MouseClickDrag("left", 850, 560, 865, 560)

Send("^c")

$chatraw = _ClipBoard_GetData($CF_TEXT)

MsgBox(1, "Chat", $chatraw)

Still the same Windows Error Message.

Share this post


Link to post
Share on other sites
JohnOne

Thanks for the fast answer, JohnOne.

I just tried this:

Still the same Windows Error Message.

Try this

MouseClickDrag("left", 850, 560, 865, 560)
Send("^c")
Sleep(100)
MsgBox(1, "Chat", ClipGet())

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
nAutoIT

Thanks a lot, that did the trick.

So i just used the wrong function, did i? Tested a little more and every time i use _ClipBoard_GetData() the script crashes. Took a look at the Clipboard.au3, but i dont know anything about C++, DllStruct calls and memory allocation. Did i use _Clipboard_GetData() wrong, or is there a problem with my Computer?

Share this post


Link to post
Share on other sites
JohnOne

To be honest, I'm quite noob at this, so I have no idea why Clipboard.au3 is not working as you expected as I've never used it.

It just looked as though you didnt need it.

Happy to help.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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.