'How do i write a loop that copies and paste from the clipboard

Im trying to write a loop that copies and paste from a clipboard i titled InitialWords.txt what i acutally want is for it to copy the words line by line and press the F2 key after each word. Heres what i tried-

Loop , read C:\InitialWords.txt
 { 
    Loop , parse , A_LoopReadLine , %A_Tab%
    {
     clipboard= %A_LoopField%
   send ^v
   send {F2}
    }   
 }

Thanks id appreciate any help.



Solution 1:[1]

It appears you were missing a comma after Loop, Read. You can also bypass using the clipboard altogether.

Loop, Read, C:\InitialWords.txt 
{ 
    Loop, Parse, A_LoopReadLine, %A_Tab% 
    { 
        Send %A_LoopField%
        send {F2} 
    }

}

Solution 2:[2]

Loop, Read, InitialWords.txt
{
   Loop, Parse, A_LoopReadLine, %A_Tab%
   {
        SendPlay % A_LoopField
        Sleep % strLen(A_LoopField)*2
        SendPlay, {F2}
        Sleep 300
   }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Elliot DeNolf
Solution 2 T_Lube