Get path of Special folders on Mac

How do you get the path to special folders on your Mac, you can use MacScript in VBA like in the macro below if you want to get the path of your Desktop folder and other special folders on your Mac. For example Environ and FSO is not working like in Windows or not at all on a Mac. Change the NameFolder string to the special folder name that you want to get from the system in the macro below.

With most folders you can use one line of code
MsgBox MacScript("return posix path of (path to desktop folder) as string")

But for Documents and Home you need a replace line like I show you in the macro below, see why when you test this line: MsgBox MacScript("return posix path of (path to documents folder) as string")

Application.DefaultFilePath
will also give you the wrong documents path


For example you can use this line instead of the msgbox line to open a file in your desktop folder if you want : Workbooks.Open SpecialFolder & "FileName.xlsx"

Tip: You can use Environ if you want for the username on your Mac for example but not for other things.
Environ("USER") and Environ("LOGNAME") give you both the name
01/06/2024
Web design by Will Woodgate