can select a file using
clickData.func.command.RunCommand('Select "cycle modes.png"')
but cannot select a folder using
clickData.func.command.RunCommand('Select "foo bar sum (64px & 24px)" TYPE=dirs')
Nothing to do with RunCommand or scripting. The same command would fail in a normal button.
( and ) are wildcard characters, so add the EXACT argument to treat them literally. (Alternatively, if other wildcards are needed, the brackets can be escaped.)