You can also call a CMD “for” command (or PowerShell Cmdlet) to loop through results of relevance substitution. For this example I created various folders with the name starting TEST then this action script command deletes them via a CMD “for” loop
run cmd.exe /k "for %a in ({concatenation " " of pathnames of folders whose (name of it starts with "TEST") of folder "C:\TEMP"}) do rmdir %a /q