Jump to content

Copy and paste into a variable?


Recommended Posts

Lets say you want to have AutoIt go click and drag over some text and then press ctrl+c to copy it it. Is there some way to dump that info into a string variable in the program? Thanks for any help you can provide.

Link to comment
Share on other sites

Here's a little example if you needed it :3

Source :

Global $Clip = ''; Variable to store Clipboard data
HotKeySet ('!{Esc}','_Exit'); Alt+Esc = Exit 
HotKeySet ('!c','_Clip'); Alt+C = Set Clipboard data to $Clip
While '1'
Sleep ('100'); Makes CPU usage 0% 
WEnd
Func _Clip ()
$Clip = ClipGet (); Get data from the clipboard and set it to $Clip
ConsoleWrite ('$Clip : ' & $Clip & @CRLF); Log $Clip to console (?For debugging?)
EndFunc
Func _Exit ()
Exit 
EndFunc

Hope this helps! :)

- John

Latest Projects :- New & Improved TCP Chat

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