How do I get the label as a variable from selected file/folder?

Hi, I just want a button that selects all files with same label as currently selected file.

I found a button script that selects all files of a certain label

Select NOPATTERN SHOWHIDDEN
@nofilenamequoting
Select Orange FILTER 

how can I tweak it to make multiple files/folders be selected with same label as currently selected file?

it seems simple but I cannot seem to find solution in manual.

tips greatly appreciated

Ben

Please link your account.