Thanks for the reply @eskimo!
So if I use NSOpenPanel() in my finder sync file and the user selects the home folder, will that give my app access to all sub folders and files and they won't have to give that permission again? Would you say this is a better approach than trying to use a temporary exception entitlements? I don't plan on shipping the app on the Mac App Store.
Also thanks for the notice about InputStream.
This is what i'm trying to use now but it just produces a very buggy and unusable window and I can't get the window to show when running it in override func beginObservingDirectory(at url: URL) {}
class FinderSync: FIFinderSync {
override init() {
super.init()
// Check if there is a previously selected folder URL
let defaults = UserDefaults.standard
guard let selectedFolderURL = defaults.url(forKey: "selectedFolderURL") else {
// Show the NSOpenPanel to select a folder
let openPanel = NSOpenPanel()
openPanel.canChooseDirectories = true
openPanel.canChooseFiles = false
openPanel.allowsMultipleSelection = false
openPanel.prompt = "Select a folder"
if openPanel.runModal() == .OK, let url = openPanel.urls.first {
// Store the selected folder URL
defaults.set(url, forKey: "selectedFolderURL")
}
return
}
}
Thanks for your help.