Jump to content

Recommended Posts

Posted (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 by demonachize
Posted

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.

Posted

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.

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
  • Recently Browsing   0 members

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