Applescript sandbox

I have a basic AppleScript that was exported as an app, signed and notarised using SD notary. This all appears to have worked properly, however when someone else runs the AppleScript app it crashes. Upon further investigation it appear to be sandboxed when trying to access the downloads folder.

The AppleScript in question copies files that were downloaded with it.

using parentFolder for (path to me) gets a gibberish path like this

(/private/var/folders/nd/n_8nk1tx39z1kq7q6l_sblvw0000gn/T/AppTranslocation/5495F8B6-2AE1-467A-92EF-CD64B0EDE7F8/d)
(5495F8B6-2AE1-467A-92EF-CD64B0EDE7F8:d)

Is there a way ti give the AppleScript app access to the download folder it is running from?

I think I mis-read your post. The problem you are seeing is the result of running the app while it is still in the downloads folder. The user needs to:

  • Unzip the file containing the app.

  • Move the app to another folder. (And then move any files it needs to find in its own folder.)

Generally it’s better to include the files in the bundle, or use a prompt for the use to find them.

I have tried above but still seems to get sandboxed, added NSDownloadsFolderUsageDescription
XXXX wants access to your Downloads folder
and then re-signed and notarised but when the file is downloaded to another Mac and run it crashes, I have “Log” statements outputting the path and they look as if they are getting sandboxed.

e.g.

log myPath

result:

(F033E840-EB3A-4A2F-A4A8-5B3C9BF468A1:d)

and

(/private/var/folders/nd/n_8nk1tx39z1kq7q6l_sblvw0000gn/T/AppTranslocation/F033E840-EB3A-4A2F-A4A8-5B3C9BF468A1/d)

Any other suggestions ? THANKS

That’s not sandboxing – it’s what’s call App Translocation. You have to unzip and move the file out of the downloads folder before running it. See my later message above.