FileMaker does not have a native solution to this problem - at least not a great way to do this. I usually resort to a free plugin from BaseElements, in part because I (almost) always include the plugin with the solutions I build.
As Marc mentioned, the BaseElements plugin will let you do this. Its free. They also have a few custom functions that manipulate the returned path so that it works with native FileMaker and BaseElements. When you look at the documentation you will see what I mean.