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 good or not at all on a Mac. Change the NameFolder string to the special folder name that you want to get from the system.

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 also a replace line like I show you in the macro below, see why when you test this line, Application.DefaultFilePath will also give you the same path if you use this code line: MsgBox MacScript("return posix path of (path to documents folder) as string")


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"
23/03/2024
Web design by Will Woodgate