Sandboxed app: renaming files gives write error

Yeah. I wasn’t clear. I meant to say users may drop whatever onto the app. Dropping folders works OK by a technicality, but dropping files (or double-clicking them) doesn’t. There isn’t an entitlement to “write to file’s containing folder”, which sounds to me useful.

Hi Mike,
I am running into the very same issue you had with your app. I develop an application called Tagr, also for Mac OS X. The app allows editing ID3 tags and renaming files based on that. I am looking into how I can request the TE for Tagr. Can you share what exact TE you requested?

Looking at https://developer.apple.com/LIBRARY/mac/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/AppSandboxTemporaryExceptionEntitlements.html#//apple_ref/doc/uid/TP40011195-CH5-SW1 I am not sure which one to pick.

I would like to grant as much of an unrestricted access to files as I can. I assume it’s the same for your app.

Thanks for sharing!

Harald

Hi Harold,

I got rejected when I tried TEs. Eventually I went with a system that checks for a bookmark on containing folders. If one is not found, it presents a dialog telling the user they need to authorize write access (makes them select the folder). After they select the folder I have write access to everything beneath it. Then I save the resulting bookmark for future use.

I also save bookmarks whenever users select folders/drag items.

That makes it minimally invasive. The only time I have to ask for permission is when users drag files instead of folders.

Then you just use a standard absolute path read write entitlement.

Mike this is exactly how I do it, I had a lengthy discussion via email with an Apple tech in 2012 over this whole issue. Eventually I described to him the method you have said, and he said yep that’s the way to do it. It is, in fact, the only way I have found which works. The app(s) were accepted into the store, but over the subsequent years I have had some App Store reviewers reject them because the app asks for permission to access files which have not been bookmarked. I point out that the Apple tech said this is the correct way, and sometimes the app goes through and other times it does not. Recently I resigned all my apps to be compliant with up-coming OS X’s, and submitted them only to have many rejected again on the security scoped bookmark issue. This time they’re not accepting what ther Apple tech said (even when i present the emails) so I can’t update any of my apps for the store now.

If I don’t present a ‘grant access’ folder dialog for non-saved bookmarks, the app won’t work with the files the user has selected/drag-dropped.

Harald, don’t get your hopes up regarding the TE! I do know of a couple of people who’ve fought with their reviewer to get them to allow the use of TEs.

I tried to use a TE to solve an issue on 10.7 and another issue. I got flat out denied. They refused to budge, so I had to simply apologize to my 10.7 customers and the one customer who had the other issue (it’s to do with being able to create executable files).

Heck I’ve even heard of a developer who fought hard enough, he’s allowed to release a brand new application that still uses Quicktime, while the rest of us mere mortal got denied!