I found another, cooler, way to do it. This way requires two macros. The first macro looks like this:
And the second macro, which must be in a different group, which I have called "Test v4", looks like this:
EDIT: I forgot to mention you have to choose these settings on the Semaphore action: