Command to separate a clip into multiple clips based on linebreaks #2720
willswords
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
Or another approach would be to change the way paste works - only paste the top line until the linebreak of the clipboard and then delete that top line. Another tool does it this way: https://forum.keyboardmaestro.com/t/separate-each-line-on-system-clipboard-onto-its-own-clipboard/31082/15 |
Beta Was this translation helpful? Give feedback.
0 replies
-
To split the selected items, you can add the following command (here is how to add the command to CopyQ): [Command]
Command="
copyq:
const text = str(input());
const lines = text.split('\\n').reverse();
for (const line of lines) {
if (line)
add(line);
}
select(0);"
Icon=
InMenu=true
Input=text/plain
Name=Split Lines |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Starting with text on the clipboard like this:
1 What is 4+4?
Eight
Two
Three
Twenty
I would like to run a command that puts each row of text into its own clipboard entry, e.g.
1 What is 4+4?
2 Eight
3 Two
4 Three
5 Twenty
This would make it much easier to paste each row separately into a tool for building quizzes. Is it possible to do this with CopyQ?
Beta Was this translation helpful? Give feedback.
All reactions