Sandboxing and Authorized Directories

Sandboxing is a technology introduced with Mac OS X 10.7 (Lion) intended to provide extra security. In order to enforce these enhanced security measures, Apple has ruled that all applications sold via the Mac App Store must be sandboxed. Sandboxing provides this extra security by limiting the tasks that applications are allowed to perform. One such limitation is that applications can only access files and directories to which the user has granted access using an Open or Save panel.

This means that Scrivener is unable to open or access arbitrary files on your system without you telling it to. For the most part, this is fine - when you open a Scrivener project, most of the files it needs are contained within that project file and, by opening the project, you have given Scrivener permission to operate on those files, meaning that you can edit, save and work as usual. However, there are certain types of files that, under sandboxing, Scrivener will not be able to access so easily:

How to Grant Scrivener Access to More Files

Fortunately, there's an easy way to grant Scrivener permission to various locations on your computer so that Scrivener can still use all of these files. Here's how:

  1. Go to the "Scrivener" menu and select "Authorize Folder Access...". This will open the following panel:
  2. dir-access-panel

  3. To grant Scrivener permission to access external files, simply click on the "Add Directories..." button. This will bring up an Open panel from which you can select the directories you wish Scrivener to have access to. Alternatively, you can just drag files into the "Accessible Directories" list from the Finder.
  4. To stop Scrivener accessing files, select the directories in the list that you no longer wish Scrivener to have access to and click on "Remove Access".

Tips

When you grant Scrivener permission to access a directory, it will be able to access all of the files inside subdirectories of that folder too. Thus, you only need to select the highest level folders with which you feel comfortable for Scrivener to have access.

The main thing to consider when adding directories to the list is which files you need Scrivener to access. For instance:

Essentially, though, for any files you want to be able to view in Scrivener that are not stored inside the Scrivener project, you must grant access to one of the folders containing that file. For instance, suppose you have added the file ~/Documents/Ideas/Writing/MyGreatIdea.pdf as a reference in one of your projects. For Scrivener to be able to open that file, you must grant access to one of the following folders:

Granting Access to Hidden Folders

Some folders are hidden in the Finder, making it difficult to grant Scrivener access to them. For instance, for KindleGen to work correctly when compiling to the Kindle .mobi format, it requires access to the hidden /private/tmp folder. In the case of Kindle export, Scrivener will walk you through authorising the /private/tmp folder when you go to compile to that format. However, you could equally add it using the Finder's "Go to Folder..." feature, like so:

  1. In the Finder, open the "Go" menu and select "Go to Folder...".
  2. In the text field that appears, type, "/private" and click on "Go". This will open the contents of the /private folder in a regular Finder window.
  3. In Scrivener go to the "Scrivener" menu and select "Authorize Folder Access..."
  4. Bring up the Finder and, from the Finder window displaying the contents of the /private folder, drag the "tmp" folder and drop it into the "Accessible Directories" list in the "Authorize Folder Access" window in Scrivener.