Extracting parts of folder names for a folder of folders is working but trying to set the metadata field Comment is problematic as using
command = 'SetAttr META "comment:' + metadata + '"';
is only working on the selected folder. Is there a way of having it work for the current item in the loop ?
The Command object lets you tell it which file(s)/folder(s) to work on. The one given to you via clickdata.func.command has the selected items set on it for convenience, but you're free to clear/modify that list.