Depending what you want to do with the lines once they are split there are various ways you could go about this. Could you describe what you want to do with each line once they are split out?
Will there always be 4 lines or sometimes more or less than 4?
Okay. This will do that. (The magenta Action at the top would not be needed in real use as you will be copying the lines. And the last green display Action is only there to show the results.)
I added in a Filter Action to reverse the lines so the first line is the latest in the Clipboard History. If you do not want that you can delete the Filter Action.
After running this you will see the lines in the Clipboard History Switcher as separate past Clipboards.
Thank you, that is greatly appreciated. I am confused to find that this macro works exactly as intended, however, the pastebot clipboard does not reflect the changes, but the Keyboard Maestro clipboard does.
I will make a macro that serves the purpose of the sequential paste using Keyboard Maestro. That should be pretty straightforward.
Clipboard utilities don't always play nice with each other...
I would probably rate this as a bug and report it to the Pastebot people, but I would want to run some tests first. (It turns out that they have a demo.)
I have to slow down the copy to clipboard actions by fully 1/2 a second to get them to stick in Pastebot...
The existing macro in this thread is perfect, I just need it to not remove duplicates because I am pasting data into an agenda and many of those fields are the same.
I'm going to paste the lines one by one into fields in WordPress. I have a second macro that pastes the top item in the clipboard and then deletes it.
Hi @stationagent - it’s not the saving macro that is removing the duplicates. That is what Keyboard Maestro’s Clipboard History does. And as you are using a Keyboard Maestro macro to paste past clipboards it will not allow duplicates.
So not perfect, then. Look at doing it something like this, assuming your first line goes into the first field etc. In pseudocode:
go to first field in web form
for each eachLine in variable
set the system clipboard to contents of eachLine
paste from system clipboard into active form field
keystroke Tab
end for each
...mimicking what you'd do manually.
For more precision you could look at using Javascript to set the fields, by name or id, to the values you want.
I had another think about this. Instead of having two macros it would be simpler to just have a Paste Macro that pastes each line of a single multi-line Clipboard entry one line each time. In other words, no need to split the Clipboard entry into multiple past Clipboards or into Variables.
To use the below Macro, copy the multiple-lined selection to the Clipboard as you normally would by selecting all the lines in one go and pressing ⌘C
Then each time the below Macro is run it pastes one line from the copied text, working its way down the lines one each time. The good thing is that it will allow duplicate lines.
(The method to remove the first line of the Clipboard entry each time is by @Tomhere.)
Another thing. If you leave the Keyboard Maestro History Switcher open (and make it as small as you can) the top entry will show what lines remain and you can see what line will be pasted next (a bit like Pastebot).
EDIT: I have updated my Macro in my post above to version 2.00 to clean up the past clipboards and make this display clearer.