Hi Bitli,
In previous scripts I used File.extractDrive(name) + File.extractDirectory(name). Seems to work on Win and Mac, don't know about other platforms.
In new script I am working on I don't bother, as PI seems to remember and use a directory by default most of the time. However if the saved directory no longer exists PI reverts to its install directory, which I find annoying. I wish PI would search up the directory path for an existing directory, and stop there. IMO this would save navigation time.
Mike