0

Scenario: I write an macOS-app that gets an export file from a banking app by apple script. The banking app stores the export file to /var/folders/.../filename.csv

var inputFile = inputFile
inputFile.removeFirst()
let inputURL = URL(fileURLWithPath: inputFile)

print(inputURL)

So inputFile is /var/folders/.../filename.csv. inputURL instead is now file:///Users/name/Library/Containers/[myAppID]/Data/

How can I access to the system folder and in the end to the exported file? And does the third slash in file:/// cause trouble?

mihema
  • 158
  • 1
  • 10
  • Obviously your app is sandboxed. This means you don't have access to the files and folders outside of your app container. The only way is to show the open dialog and let the user select the folder `/var`. The third slash in a `file://` is intended. It represents the root folder of the startup disk. – vadian Jun 27 '22 at 06:59
  • Thank you. Isn't it possible to add the path to exeptions, so macOS asks me for access? – mihema Jun 27 '22 at 09:19
  • No, it's not possible. – vadian Jun 27 '22 at 09:48

0 Answers0