When my app starts it checks the documents folder for a file and adjusts some buttons in the app accordingly. macOS poses an alert saying "such-and-such program would like to access files in your Documents folder." with options "Don't Allow" and "Ok". Which is all fine, the user decides and we carry on (I have yet to test the "Don't Allow" option, I suspect my app is dead in the water at that point as it uses that location for a backup and some scratch files).
However later I want to access the Safari bookmarks file located in /Library/Safari/. The macOS does not present an alert allowing the user to authorise this, but instead just returns an empty zero-byte file to my app. I detect this and put up my own alert which at present just says
Code: Select all
"SafariSorter needs access to your bookmarks folder. Please enable Full Disk Access in System Preferences in the Privacy tab."
My app does have an info section and I provide the steps required to do this yourself:
1. Open System Preferences
2. Select the Privacy tab in the Security & Privacy section
3. From the left hand menu select "Full Disk Access"
4. Check the box next to "SafariSorter"
But I am looking for a more elegant solution (maybe using a pList or entitlements setting)?
I should add that I know that Apple does not want to encourage people to play with the Safari bookmarks file, but they do not restrict access if the user provides authorisation. I am just looking for a cleaner way to allow a user to provide that permission.
Thanks for any ideas you might have. For a guy who has 190 bookmark folders and 10's of thousands of bookmarks, sorting this mess was greatly facilitated by having this app, so at the very least I have a personal solution. Although, it might be nice to share it with the world.
Mark