Mac equivalent of ENV['APPDATA']

So, is ENV["APPDATA"] John. It is in the user’s path.

It resolves to …
"#{ENV["USERPROFILE"]}/AppData/Roaming/"
which in my case is …
"C:/Users/Dan/AppData/Roaming"


On Mac (I think) the equivalent would be …
"~/Library/Application Support/"
where the “~” in Ruby will resolve to the user’s home directory … Ie …
ENV["HOME"]
… ie, in the User path.


CAUL only needs to decide whether to create his data folder in a version independent way.
If not, then he can indeed put his files in a subfolder of his extension folder.

If he wants it version independent, then it goes somewhere in the AppData user path.
If he wants to treat himself like any other application software entity, he can create a company folder at the same level that others do. (Ie, directly in the AppData/ApplicationSupport folder.)
If he wants to associate directly with SketchUp, but still version independent. Then his company folder could be created as a subfolder of "#{ENV["APPDATA"]}/SketchUp". (He needs to keep in mind this needs to be done for each user account on a computer as this is still within each user’s separate path.)


If he wants both user and version independent, then this is where permissions issues have problems because the ENV["ProgramData"] (Win) / “HD/Application Support” (Mac) paths need admin privileges.

There are other topic threads where weve discussed this ad nauseam.

1 Like