AddFile can't handle file objects

The AddFile() method can't process file objects directly, it wants them converted to a path string, like so:

var outFile = fsu.GetTempFile();
cmd.AddFile(String(outFile));

That seems odd, given the fact it can handle item and path objects.

GetItem() e.g. is fine with file objects (despite the docs stating it expects strings as argument).

Thanks! That will work in the next beta. (As long as the File object actually has a path. Memory-only ones won't work, of course.)

1 Like