Jump to content
Sign in to follow this  
Guest Drache

Newbie copying text off a screen into autoit

Recommended Posts

Guest Drache

I am trying to copy text of an old mainframe system using ctrl c. I then have to switch to the spreadsheet to paste. Is there a way that autoit can copy the text and store it within an array within the script?

Cheers

Share this post


Link to post
Share on other sites
DaLiMan

Maybe something like:

Global $Copy = Send ("^C")

Have not tried it yet...

Share this post


Link to post
Share on other sites
pekster

Is there a way that autoit can copy the text and store it within an array within the script?

I don't know what excatally you'll be using an array for, but once you have the text into a variable you can either put that into an array, or parse the value itself so each character goes into an array element, or whatever. This should get you started:

Send("^c");send the Ctrl-c to copy current selection to the clipboard
$text = ClipGet();get the clipboard text and put it in $text
If @error Then;if this occurs, then the clipboard was empty, or invalid (non-text)
  MsgBox(0, "Error", "Invalid text in the clipboard");let the user know
  Exit;and then exit
EndIf
;otherwise, do something with the $text var here

Variable name in my last comment correct to match the rest of the example code

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites
Guest Drache

Thanks worked a treat

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  

×