Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Mid-Macro copy from 1st .txt line and paste into app, then 2nd, etc.

$
0
0
Hi all, I have a relatively simple script I have been trying to write... my apologies for not referencing how I began but I have a script that I am trying to implement keyclicks and mouseclicks...  I would like to be able to copy the line of a text file, from start to finish, but command when the paste is happening. It is not once per whole macro loop (it is twice).  I have attached the code I am trying to improve upon.
[ autoit ]         
Local Const $File = "C:\Users\Brandoom\Desktop\practice.txt" WinActivate("Creo Parametric") Global $Handle = FileOpen($File, 0) If $Handle = -1 Then MsgBox(0x10, 'Error', 'Could not open the file:' & @LF & $File) Exit EndIf HotkeySet('^{RIGHT}', 'NextLine') HotkeySet('{ESC}', 'Done') NextLine() While 1 Sleep(0x7FFFFFFF) WEnd Func NextLine() Local $NextLine = FileReadLine($Handle) If @Error Then MsgBox(0x40, 'End of File', 'The end of the file has been reached.') Done() EndIf ClipPut($NextLine) TrayTip('Copied to Clipboard', $NextLine & @LF & @LF & 'Ctrl+Right: Next line' & @LF & 'Esc: Quit', 5, 1) EndFunc Func Done() FileClose($Handle) Exit EndFunc

Again, I would like to be able to copy and paste from a text file line by line, and have a hotkey that increments the FileReadLine or something to that effect to process through an entire .txt file.  I cannot seem to get it to do my mouseclicks and send commands without restarting from the beginning of the script after I press the paste hotkey ctrl+right.  Thank you all for your help!

B

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>