demonachize Posted May 5, 2012 Share Posted May 5, 2012 (edited) I have a text file that I am using as an array and I want to be able to paste the first line from the file using CTRL+V and then have it send the Ctrl+v command to windows. I don't seem to be able to interact with my array correctly after generating it. Here is what I have so far: Global $aArray Global $sTxtFile = ".file.txt" If Not _FileReadToArray($sTxtFile, $aArray) Then MsgBox(4096, "Error", "Error reading file to Array error:" & @error) Exit EndIf HotKeySet("{ESC}", "Terminate") Func Terminate() Exit 0 EndFunc HotKeySet("{^v}", "Paste") Func Paste() For $iLine = 1 To $aArray[0] ClipPut($aArray[$iLine]) Send("^v") Next EndFunc Any Ideas? Edited May 5, 2012 by demonachize Link to comment Share on other sites More sharing options...
JohnOne Posted May 5, 2012 Share Posted May 5, 2012 Global $aArray Global $sTxtFile = ".file.txt" If Not _FileReadToArray($sTxtFile, $aArray) Then MsgBox(4096, "Error", "Error reading file to Array error:" & @error) Exit EndIf HotKeySet("{ESC}", "Terminate") Func Terminate() Exit 0 EndFunc HotKeySet("{^v}", "Paste") Func Paste() For $iLine = 1 To $aArray[0] ClipPut($aArray[$iLine]) HotKeySet("^v", "") Send("^v") HotKeySet("^v", "Paste") Next EndFunc 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 More sharing options...
demonachize Posted May 5, 2012 Author Share Posted May 5, 2012 I think that I had the cycling right. I am having trouble with the putting into the clipboard from the array maybe. When I run the script, I can paste and the like but the clipboard content is just whatever was there already. Link to comment Share on other sites More sharing options...
JohnOne Posted May 5, 2012 Share Posted May 5, 2012 Then check the contents of it with clipget() before you try to put it. 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now