Toggle attributes for multi-selection not working

Hi,

I have the following button

@nodeselect
SetAttr TOGGLEATTR=r {allfilepath$} RECURSE

This works if I select only ONE file not more. When selecting a folder it only applies the attribute to the folder itself but not to its contents as expected from "RECURSE".

Can anybody confirm this?

Thanks
xbprm

Remove the {allfilepath$} completely and it should work.

Filename arguments usually only take a single name, not multiple names like you're giving there. If you want a command to act on all selected items then you usually shouldn't specify a filename at all as that's what most commands do by default.

The filename arguments are there so you can make commands which act on specific files (e.g. hardcoded into the command). Commands that act on the selected files don't need to use those arguments.

Many thanks leo. Works like a charm.