StandardAdditions has the path to command and we can use it to get known locations.
For example, path to home folder returns a file reference to the user folder and if we want the posix path, we can do POSIX path of ((path to home folder) as text).
In Terminal.app we can use the tilde character (~) to represent the home folder.
How can we do this tilde expanding in AppleScript?
Started with
OS X 10.10you can easily accessCocoa classesand their functions and properties:In
10.9you have to define such handlers inScripting Libraries, that's less nice than it sounds. But in10.10this works out of the box!