Rs.DocumentPath() returns different results Windows-Mac

In Windows, rs.DocumentPath() returns the path plus the filename.
On Mac, rs.DocumentPath() returns just the path, without the filename
This obviously can create problems for cross-platform scripts.

if you run the following on both Windows and Mac platforms, you will see the difference:

import rhinoscriptsyntax as rs
import scriptcontext as sc
print sc.doc.Name
print rs.DocumentName()
print sc.doc.Path
print rs.DocumentPath()

In Windows you will see the first two and the second two are the same;
on Mac the second two are not the same.

The workaround is obviously not to use DocumentPath() but instead scriptcontext.doc.Path, but perhaps this should be corrected?

Thanks, --Mitch

Hi Mitch,

The correct version is the one that returns the path w/o the file name just like in RhinoScript. It was fixed a while ago in WIP but didn’t make it into sr12. I’ve marked it so it will go out in sr13 if there is one.

Thanks

OK, that’s the way I prefer it too, you can always join the path and name easily, a little bit more of jumping through hoops to extract just the path from the complete path+filename… Thanks, --Mitch