How to modify a variable/clipboard?

I’m trying to create a macro that:

  • cuts the first line from a variable/clipboard pre-populated with a bunch of lines
  • runs through a set of actions
  • appends the first line that was cut at the end of the variable/clipboard

For example, if I had the variable:
a
b
c
d
Then, it would run the macro using “a” and at the end, the variable would be:
b
c
d
a

Search Variable for (.*)\n(?s)(.*) will let you break the variable into the first line and the rest.

Then add it back by setting it to %Variable%Rest%%Variable%First%\n

2 Likes

Peter, is the "1" a typo? I don't believe it is needed in the RegEx.

For those interested in understanding or learning RegEx:

2 Likes

Yes. When I first put in the backticks, I pressed 1 for each one instead of backtick, and clearly when I went back and replaced them I missed one.

1 Like