Page 1 of 1

Pasting each line one by one

Posted: 28 Dec 2023, 19:01
by CodingNoob-_-
Hi! :D I was curious on how to paste each clipboard line by line.

(e.g. clipboard is:
one
two
three
four
five)

^v #1 would be: one (`r)
^v #2 would be: two (`r)
^v #3 would be: three (`r), etc.

I was thinking about doing the following:

1. Get the clipboard on ^v
2. Store the clipboard
3. Get the first line of the clipboard
4. Paste that
5. Get the stored clipboard
6. Remove the first line of the stored clipboard
7. Copy it to clipboard.

Thank you! :D

Re: Pasting each line one by one

Posted: 28 Dec 2023, 21:04
by Xtra
Example:

Code: Select all

/*
one
two
three
four
five
*/
~^c::arr := StrSplit(Clipboard, "`n", "`r")

#If (arr.Count() > 0)
^v::Send % arr.RemoveAt(1) . "`n"
#If