Discussion Locked

Find path to Application Support directory in python in MacOS

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I've been working on a mac app for a long time now, under the assumption that everyone has their Application Support folder located at /Users/[user_name]/Library/Application Support. However, I recently learned this is not true. I need something I can do in python to get the path to the Application Support directory on anyone's computer. Everything I've seen so far has been very outdated with respect to python. The only leads I have are some PyPi packages, PyCocoa and pyobjc-framework-Cocoa. I intend for this to work across several recent OS versions (one person has Monterey, one has Catalina, one has Big Sur, I have Mojave), and it seems that the path to the Application Support folder has changed across versions. What is the accepted way to find this folder on any computer?

Thanks!

1 reply

by rproffitt edited

Why I say that is that the app support folder appears to be per app. I might not be able to assume that the app support folder for all apps is the same.
Anyhow, to find the app support folder for a particular app has an example at https://lethain.com/writing-to-application-support-in-pyobjc/
Now you could try that and see if the parent folder for the app is what you were looking for.

This discussion is closed to new replies.