# SandBox application

**URL:** <https://forum.xojo.com/t/sandbox-application/18890>\
**Category:** macOS\
**Created:** [August 26, 2014, 11:17am UTC](https://forum.xojo.com/t/sandbox-application/18890 "2014-08-26T11:17:38Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [August 26, 2014, 11:17am UTC](https://forum.xojo.com/t/sandbox-application/18890/1 "2014-08-26T11:17:38Z")

</div>

I downloaded three days ago a sandboxed application.

It keeps ask me to click in an Extract button because of sandboxing. If I click cancel, as one would expect, nothing is done (the save is not done).

Is this usual ?

BTW: that is that application who sas it is sandboxed.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [August 26, 2014, 12:20pm UTC](https://forum.xojo.com/t/sandbox-application/18890/2 "2014-08-26T12:20:40Z")

</div>

This sounds like an issue you should bring up with the developer of whatever app that may be.

---

<div class="post-metadata">

**Author:** ![Roger\_Clary](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/eada6e/32.png) [@Roger\_Clary](https://forum.xojo.com/u/Roger_Clary)\
**Post date:** [August 26, 2014, 12:22pm UTC](https://forum.xojo.com/t/sandbox-application/18890/3 "2014-08-26T12:22:19Z")

</div>

Depending on where you downloaded it, I might be very leery of that app.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [August 26, 2014, 1:37pm UTC](https://forum.xojo.com/t/sandbox-application/18890/4 "2014-08-26T13:37:09Z")

</div>

What application? There could be a bunch of reasons as to why this happens.

For instance I implemented a ‘Restore’ function to Backup To Go, but it doesn’t work if the original file has been deleted (which is why you’d backup). Turns out that a Security-Scoped Bookmark is only valid, when the file exists. If the original file is deleted, I can’t re-open that bookmark to restore it. So I have to ask the user to choose where to ‘Restore’ their files to.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [August 30, 2014, 8:16am UTC](https://forum.xojo.com/t/sandbox-application/18890/5 "2014-08-30T08:16:59Z")

</div>

The application comes from the App Store.

The situation evolves with time: sometimes it ask only once and never ask again and some reboot later (afternoon, the day after), it consistently ask to confirm the Extract location

Sam: this is an archive expander (I use it as is); and no, I do not ask to delete the archive file to expand (I prefer to keep it for security reasons).

Very strange.

On the other hand, the application works fine.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 1, 2014, 9:00am UTC](https://forum.xojo.com/t/sandbox-application/18890/6 "2014-09-01T09:00:01Z")

</div>

Here’s the Extract buttons Parent window:

![](https://www.mediafire.com/convkey/b3fc/at2j8nopx1o7e8g6g.jpg)  
The text explain why this window is displayed and that the permission will be set to write into that folder (remembered for later use).

Unfortunately - as I wrote above - this is not alwyas true; it is false, most of the time.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 1, 2014, 9:17am UTC](https://forum.xojo.com/t/sandbox-application/18890/7 "2014-09-01T09:17:38Z")

</div>

Since the image is not displayed (but due to McDonalds France WiFi Third Party filtering it), here is the image link:  
[https://www.mediafire.com/convkey/b3fc/at2j8nopx1o7e8g6g.jpg](https://www.mediafire.com/convkey/b3fc/at2j8nopx1o7e8g6g.jpg)

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 1, 2014, 10:45am UTC](https://forum.xojo.com/t/sandbox-application/18890/8 "2014-09-01T10:45:46Z")

</div>

I can confirm the filtering (for me and probably all McDonalds customers in France) as I can see my screen shot from a different location (not filtered).

Weird !

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [September 2, 2014, 12:06am UTC](https://forum.xojo.com/t/sandbox-application/18890/9 "2014-09-02T00:06:45Z")

</div>

Ok, this makes sense and I yes it does have to operate in that manor, you can only read and write to files or folders that your application has permission for.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 2, 2014, 9:55am UTC](https://forum.xojo.com/t/sandbox-application/18890/10 "2014-09-02T09:55:44Z")

</div>

Yes Sam, but only the first time you run the application, not nearly everytime. (nearly because it asked me once in a session, one day, then never do that again.)

By everytime, I mean: it ask me all the time in the same running session.

If he asked me the first time I run it in each live sessions, OK. But thousand times in a session ?

At last, what if i wrote an AppleScript to deal with a folder full of archives ?

BTW: this is not in Off-Topic, because I also want to know if your applications (yes, my fellow programmers), your sandboxed applications buit with Xojo works the same.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [September 3, 2014, 12:13am UTC](https://forum.xojo.com/t/sandbox-application/18890/11 "2014-09-03T00:13:20Z")

</div>

Some of what you say is due to the Sandbox mechanism. Some of it sounds like a lazy developer.

# Basically, your app can"t access users folders until a user grants it ‘permission’, either by dragging the file/folder in to the application or using a open/save dialog.

# However once you have permission, you can use either NSDocumentController to add that as a recent file, or store a Security-Scoped Bookmark to hold onto that permission (with a bit of hacking you can even retain permission by setting the window icon).

From what I understand it seems like the other developer is not holding on to permission correctly, but I can’t say for sure without exactly seeing his code. There are some issues with SSB, and he may have discovered one, or may not be using it correctly either.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 3, 2014, 7:56am UTC](https://forum.xojo.com/t/sandbox-application/18890/12 "2014-09-03T07:56:16Z")

</div>

Good catch Sam, I will experience drag and drop and Open (from File).

'till now, I only used double-click.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 3, 2014, 8:26am UTC](https://forum.xojo.com/t/sandbox-application/18890/13 "2014-09-03T08:26:49Z")

</div>

Yes, Sam you found it !

Drag and drop an archive in the application ask if I really want to do that ONCE (only).

Double-click in an archive file ask ALWAYS.

This is queer !

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:23pm UTC](https://forum.xojo.com/t/sandbox-application/18890/14 "2020-10-29T17:23:40Z")

</div>


