Sign in to follow this  
Followers 0
yellowpower

how can I save data I copy into a string variable

4 posts in this topic

After I perform the action of copying "^C"

is it possible to save the content into a variable e.g.

send("^C")
$mycopy= those that are copied

thanks

Share this post


Link to post
Share on other sites



Just one further tip, in addition to what JohnOne gave you. If you find that you are not reliably getting the correct information from the clipboard it may be necessary to add a small delay between copying the data and retrieving it from the clipboard.

For example:

send("^c")
sleep(200)
$mycopy = ClipGet()

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

Yes, best to have some sort of check

Func _Copy()
    ClipPut("")
    Send("^c")
    Sleep(10)
    $var = ClipGet()
    If Not ($var == "") Then
       Return $var
    EndIf
    Return False
EndFunc

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  
Followers 0