Sandbox - a Levure Helper for working with files in the macOS sandbox

Collaborate on tools, libraries, and applications beyond the IDE

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 994
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas

Sandbox - a Levure Helper for working with files in the macOS sandbox

Post by trevordevore » Tue Oct 09, 2018 5:29 am


I've posted a new Levure helper on GitHub called "sandbox". It adds support for working with file references across multiple app sessions in the macOS sandbox. It requires LiveCode 9 as it uses the Foreign Function Interface (aka FFI) to wrap Objective-C APIs.

If you distribute your apps through the Mac App Store then it is required that you sandbox your application. When an application is sandboxed the user has to give you explicit permission to open any files that reside outside of your applications container. For example, a user can do this by selecting a file using the `answer file` dialog or dragging a file onto your application. Your application will then have permission to access that file for the rest of the app session.

The next time your application launches, however, your application will not have permission to open the files again unless you implement security-scoped bookmarks and security-scoped urls. The helper uses an LCS library wrapped around an LCB extension to try and hide the complexity.

To learn more visit the GitHub page:

If you don't use Levure but are interested in the LCB FFI code here is a direct link to that file: ... andbox.lcb
Trevor DeVore
ScreenSteps -

LiveCode Repos -
LiveCode Builder Repos -

Post Reply

Return to “Community Projects”