Author Topic: How do I read lines from a file (or variable?) to be pasted one after another.  (Read 856 times)

dryh2o

  • Newbie
  • *
  • Posts: 16

I know how to set a variable to the text I want then use the following to paste that text:

Press Tab key and hold for 0.05 seconds and release
Pause 0.05 seconds
Set Windows clipboard to '{TXT:Purple}'
Press Left Ctrl+V keys and hold for 0.05 seconds and release
Press Enter key and hold for 0.05 seconds and release
Pause 0.25 seconds

I can also create loops. What I would like to do is to either set a variable to multiple lines or read multiple lines from a file and have VA paste them one at a time. I don't understand how to do either of those. If someone could provide an example, I could use that to learn what I need or point me to an existing example.

Thanks!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
There are some techniques shown here.

The basic idea, if you want to do it natively/manually, is to find the character(s) separating each line, store that index, find the next separator by starting the search from the position after the previous one, then retrieve the text between those positions/indices.
Then repeat the process for the subsequent lines, starting from the index after the separator ending the previous line, until the end is reached.