posix and mac traditional file/path woes...

Hi. I am trying to make a script that will work on anyone’s computer.

set x to "~/Desktop/files/file.txt"
set y to POSIX file x as Unicode text
set z to y as alias

However, unless I specify “/Users/Patrick/Desktop/file.txt” it will not work. How can I make traditional Mac path’s know the home directory?

Do I need to do some kind of Set x to file “file.txt” in folder “files” in desktop “ or something??

Thanks

patrick:

This is the simplest way to do it:

set dp to POSIX path of (path to desktop as Unicode text)

Now you have a variable (dp) that has the POSIX path to the current users desktop:

/Users/dadprogram/Desktop/

And you can build onto it however you want, since it is also a string.

casdvm

ah… thank you!