Jump to content

Send("^c") and _ClipBoard_GetData()


nAutoIT
 Share

Recommended Posts

#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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...