Can't define variable of home folder

I know this is a very simple solution, but I just can’t figure it out. All I’m trying to do is set the path to a folder inside my home folder. I have tried it about 20 different ways, and it always says “the variable home is not defined”. arrrrg. Here is what I have:


set myFile to quoted form of (POSIX path of (path to MPEG2 of home) & Nm)

I’ve also tried


set myFile to quoted form of (POSIX path of (path to MPEG2 of home folder from user domain) & Nm)

Nada…can anyone advise the oh-so-newbie?

Thanks.

Hi,

the path to your home folder is just

path to home folder
--> [alias] MacHD:Users:jsocks1:

to specify a custom folder in your home folder use

((path to home folder as Unicode text) & "path:to:myFolder:")
--> [Unicode text] MacHD:Users:jsocks1:path:to:myFolder:

if you want a POSIX path, you can coerce it directly from the alias

POSIX path of (path to home folder) & "path/to/myFolder/"
--> [Unicode text] /Users/jsocks1/path/to/myFolder/

The correct synrtax for your example is

set myFile to quoted form of (POSIX path of (path to home folder) & "MPEG2/" & Nm)

As always, thank you Stefan. This will go directly in my handbook. NOW I get it.