PathConverter is an AppleScript module to convert a path between a relative path and an absolute path each other.
An absolute path means a file path which describes complete location from a top level of a disk as follows.
Macintosh HD:Users:hello:document1.text
To talk about a relative path, consider one more absolute path.
Macintosh HD:Users:hey:document2.text
When the origin of the path is 'document1.text', the location of 'document2.text' can be expressed relatively as follows.
::hey:document2.text
This is a relative path.
Paths in above examples are HFS styles. PathConverter can also deal with POSIX styles as follows.
/Users/hello/document1.text
../hey/document2.text
The standard usage of PathConverter is :
An extra feature of PathConverter is converting a POSIX path into a HFS path with only parsing paths. Mainly it is supposed conversion of a relative path between POSIX style and HFS style.
In the case of absolute paths, conversion each other is easy using 'POSIX file' and 'POSIX path of' commands. On the other hand, direct conversion of relative paths is not straightforward. hfs_from_posix handler can help to solve such problems.