 |
|
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:
- References: Scrivener's inspector can store a list of references to external files. Because these files are stored outside the project, Scrivener may not be able to open them by default.
- Alias files: It is possible to import research files as aliases using File > Import > Research Files as Aliases... Under sandboxing, Scrivener may not be able to open such files, and when you try to open such files in the editor you will see a message telling you that the file cannot be opened.
- Linked images in text: When inserting an image into text, rather than inserting a copy of the image, it is possible to insert it as a link to the original file on disk using Edit > Insert > Image Linked to File... If the original images are stored in locations to which sandboxing does not grant Scrivener access by default, these images may not appear correctly in the text, a placeholder image being displayed instead.
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:
- Go to the "Scrivener" menu and select "Authorize Folder Access...". This will open the following panel:

- 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.
- 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:
- If you tend to import many different files into Scrivener as aliases (using File > Import > Research Files as Aliases...), or if you make heavy use of Scrivener's "References" inspector list to refer to external files, then you may wish to consider adding your entire home directory to the list of accessible directories. This will give Scrivener access to all folders inside your home directory without you having to add them all separately, such as your Pictures, Movies and Documents folders. The downside of this approach is that it somewhat defeats the point of sandboxing, which is to ensure that, should any malicious software take control of your other programs, it is limited in what it can access. Thus, although adding your entire home directory is the easiest approach, it is also the least safe in the event that your computer is exposed to malware.
- If you are very careful about where you store all the files on your hard drive, and you only tend to add images to Scrivener as linked files and import a few sound and movie files as aliases, you might only need to add the ~/Pictures, ~/Movies and ~/Music folders to the list.
- Perhaps the safest and easiest approach would simply be to have a folder somewhere on your hard drive for storing your research documents, and only grant Scrivener access to that.
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:
- ~/Documents/Ideas/Writing - in which case Scrivener will be able to access all files inside the "Writing" directory.
- ~/Documents/Ideas - in which case Scrivener will be able to access all files in the "Ideas" directory, as well as any folders contained in the "Ideas" directory and any files or folders inside those.
- ~/Documents - in which case Scrivener will be able to access all files, folders, subdirectories and sub-files within the "Documents" directory.
- ~/ - in which case Scrivener will have full access to your home folder. (Adding this is the easiest option if you do not want to have to worry about authorising the right directories every time you add a new file, but it is also the least secure.)
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:
- In the Finder, open the "Go" menu and select "Go to Folder...".
- 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.
- In Scrivener go to the "Scrivener" menu and select "Authorize Folder Access..."
- 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.