Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Oct 18, 2018 11:13 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Sandbox question
PostPosted: Tue Dec 11, 2012 12:13 pm 
Offline

Joined: Tue Aug 07, 2012 9:46 pm
Posts: 26
I have a program that makes websites. So it takes a few images, adds all the HTML to make a site, then you just upload that folder. I have sandboxed it, but running into an issue. I save a file with the configuration and that includes links to all the images. Now if I close the program and open it up again, when it reads the configuration, it can't open the files again. I don't want to make it so they have to save in one area, but maybe that is the fix. I have the entitlements set to read/write user selected files, pictures folder and a few other places. I was testing with the files in the documents folder. Any ideas how to do that with sandboxed?

Thanks

Luke


Top
 Profile  
Reply with quote  
 Post subject: Re: Sandbox question
PostPosted: Tue Dec 11, 2012 1:11 pm 
Offline
User avatar

Joined: Tue Sep 02, 2008 3:01 pm
Posts: 193
Location: Switzerland
lajdesign wrote:
<...>I save a file with the configuration and that includes links to all the images. Now if I close the program and open it up again, when it reads the configuration, it can't open the files again. I don't want to make it so they have to save in one area, but maybe that is the fix. I have the entitlements set to read/write user selected files, pictures folder and a few other places. I was testing with the files in the documents folder. Any ideas how to do that with sandboxed?..
Sandboxing means that you can automatically open or write files and folders only within the sandboxed app's container. To find the container, hHold the option key and select GO->LIBRARY from the Finder menu, then select Containers.
You can allow the user to open data outside of your container, but then you must import it into the app's container in order to automatically reopen it upon the next restart of your app. This is the whole story about sandboxing and security: apps are not allowed to access outside data without user interaction. And for the user interaction you need that entitlement...

Oliver

_________________
"Stop deluding yourself with wishful thinking and find a solution that works for what you need to do"
Tim Hare - on forums.realsoftware.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Sandbox question
PostPosted: Tue Dec 11, 2012 3:29 pm 
Offline

Joined: Tue Aug 07, 2012 9:46 pm
Posts: 26
I think that I understand, but not sure how to make that so users will like it. What I would need to do is require that documents go in the container or are copied in and modified there. If you have them select a folder, can you then get access to all the items in the folder or do they have to grant that also? Thanks

Luke


Top
 Profile  
Reply with quote  
 Post subject: Re: Sandbox question
PostPosted: Tue Dec 11, 2012 3:39 pm 
Offline
User avatar

Joined: Tue Sep 02, 2008 3:01 pm
Posts: 193
Location: Switzerland
lajdesign wrote:
... What I would need to do is require that documents go in the container or are copied in and modified there. If you have them select a folder, can you then get access to all the items in the folder or do they have to grant that also? Thanks Luke
You can get an entitlement for the pictures folder and - if I remember right - then you can open files from that folder without user interaction. You must test this for yourself. Other possible folders are:
- Downloads
- Music Folder
- Movies Folder
Unfortunately the documents folder is not available. When you look into the Data folder of a sandboxed app's container, then you see there some shortcuts (alias) to the entitled folders. But not for documents...
Oliver

_________________
"Stop deluding yourself with wishful thinking and find a solution that works for what you need to do"
Tim Hare - on forums.realsoftware.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Sandbox question
PostPosted: Tue Dec 11, 2012 3:47 pm 
Offline

Joined: Tue Aug 07, 2012 9:46 pm
Posts: 26
I will try the pictures and see if I can put it there. The documents would be much better. Thanks

Luke


Top
 Profile  
Reply with quote  
 Post subject: Re: Sandbox question
PostPosted: Tue Dec 11, 2012 7:37 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
lajdesign wrote:
when it reads the configuration, it can't open the files again. I don't want to make it so they have to save in one area, but maybe that is the fix. I have the entitlements set to read/write user selected files, pictures folder and a few other places. I was testing with the files in the documents folder. Any ideas how to do that with sandboxed?


Security Scoped Bookmarks - are what you're looking for. I've posted the code somewhere in this very forum, so you should be able to find it. However they should come with some warnings.

#1 Don't work OS 10.7.0~7.2, but do work on 10.6, 10.7.3 & 10.8.
#2 My last app sat "In Review" at Apple for 3 weeks, because I was using SSB to references image files within the Application Bundle and this is not allowed!

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group