Is there a easy way to get the path to a users home folder? I have tried this:
tell application "Finder"
set homdir to home
return homdir
end tell
and I get this returned
folder “admin” of folder “Users” of startup disk of application “Finder”
What I really want is a way to use a path something like this
“~/Library/Preferences”
but I cant for the life of me figure a way to make this work. Every computer here has a different HD name, so it can’t be hard coded either. Any sugestions?
There are a few other ways to get the paths to folders without having to use the ‘Computers Hard Drive’ name…
get quoted form of POSIX path of (path to preferences folder from user domain) -- slash "/" delimited path
--> "'/Users/username/Library/Preferences/'"
get POSIX path of (path to preferences folder from user domain) -- slash "/" delimited path
--> "/Users/username/Library/Preferences/"
get (path to preferences folder from user domain) -- colon delimited path
--> alias "Mac HD:Users:username:Library:Preferences:"
do shell script "cd $HOME/Library/Preferences/;open ." -- opens the folder