Semaphore using a variable or the macro name?

I have a macro that unmounts a disk after certain conditions (CCC clones of my system disk). I use that same macro for a few disks.

I want only one instance to run for each disk BUT I would like to run multiple disk macros simultaneously if required.

So, if I have Disk1, Disk2, Disk3 then currently I have a macro for each and the semaphore will be named say smDisk1, smDisk2, smDisk3. Each would have a timeout set to 1s and that would work. If Disk1 was running then a second run would be aborted, but if Disk2 ran at the same time then it would be fine.

Would it be possible to use a variable as the name for the semaphore?
so maybe: 'Semaphore %ExecutingMacro%" or similar?

That way each macro could only run once but I can create multiple versions which would run concurrently?

Hope I explained this okay!

Hmm, this seems to work but it looks like it is using %ExecutingMacro% as a text string not as it's actual value, but it does seem to work.

SemaphoreTest1 runs, runs itself again which is aborted and then runs SemaphoreTest2 which works.

Screenshot 2022-01-28 at 12.25.42