Posix path -> Applescript path

How can I transform a path like this “/Users/name/” into a path like this: “Macintosh HD:Users:name” so that I can copy a file.

copy pic_path to folder dest_path

where pic_path is like “/Users/name/”


you can directly address the home folder of current user with

path to home folder -- result is alias


path to home folder as string -- result is string

No what I mean is: I have a path in the posix style, that is “/Users/name” but what I need as far as I can see is something like that path “Macintosh HD:Users:name”. So how can I transform a given path “/Users/name” to the other style ?

you can do it with this:

set a to "/Users/name/"
set b to POSIX file a as string

without as string the result is a file reference