Questions tagged [security-scoped-bookmarks]

32 questions
2
votes
1 answer

SwiftySandboxFileAccess UserDefaults value

SwiftySandboxFileAccess works the first time the user approves the NSOpenPanel selection, but the next time the app opens, the security bookmark doesn't have access even though SwiftySandboxFileAccess thinks it has access just because a value is…
2
votes
0 answers

How to get access to file from security-scoped bookmark url in xpc service?

I am creating sandboxed macOS application. I obtain file url from NSOpenPanel, create bookmark data and save to data storage. Then I can successfully restore url from bookmark data and access file data from my app. I also have another target with…
2
votes
0 answers

App-Scoped vs. Document-Scoped Security-Scoped Bookmarks

Quick Question: I'm working on a document based application in OS X. Can I use an App-Scope bookmark to gain access to a file, or must it be a document-scope bookmark? I understand that any app can use both of these, but I wasn't sure if perhaps…
Greg Steiner
  • 647
  • 1
  • 9
  • 20
2
votes
1 answer

Will a URL always create security scoped bookmarks with exactly the same byte pattern?

I want to maintain a list of folders, in a sandboxed Mac app. To do that, I need to make a security-scoped bookmark, using url.bookmarkData(). Is it guaranteed that the Data returned by this method is always the same byte pattern, for a given file…
2
votes
1 answer

Security scoped bookmark stopped working on Yosemite 10.10

I am using the following code to generate security scoped bookmarks. This worked fine on 10.8 and 10.9 but has stopped working on 10.10. I am at a loss as to what to check? NSOpenPanel *panel = [NSOpenPanel openPanel]; [panel…
1
vote
0 answers

Mac OS App Sandbox - Can't Write File Without NSOpenPanel or NSSavePanel

I'm working on a Mac OS app and just ran into an interesting situation. As this is a file based app, users can drag and drop files and folders onto the app and they get added to an array and displayed in a list. They can also add files and folders…
1
vote
0 answers

Retrieve permission for a file from the command line

I am trying to write a command-line tool where I would like to access certain files that the user provides. For example, I want this to be possible: $ readOrWriteTo /some/path/to/some/file When in sandboxed mode, I cannot read and write the file…
1
vote
0 answers

How to access all of the files in the selected folder?

The user picks a folder of video clip files, which will all be sequential, and my app plans to iterate through all the files in the folder and assemble them into one complete video. This is typically on iCloud, DropBox, box or other such location. I…
BruceL
  • 71
  • 3
1
vote
1 answer

Resolving iOS URL bookmark data eventually starts failing

I have an iOS app where I'm attempting to persist and reload bookmark data using UserDefaults. Seems to work OK, but I'm having an issue where sometimes the conversion from the bookmark Data to a URL is failing. It seems to work fine for a period of…
Ryan Ashcraft
  • 454
  • 3
  • 7
1
vote
1 answer

Can an app-scoped security scoped bookmark be copied from one Mac to another?

I have a sandboxed application that uses a document format which can contain embedded filenames. E.g. some of these referenced files are for image files which the user selects in order to associate the image file with data stored in the document.…
1
vote
1 answer

How can document-scoped security bookmarks be stored in Core Data?

I have been making an app that contains several targets cooperate with each other as an app group. Problems came when I began to make it Sandboxed: the app stores URLs in the Core Data, and one target does the saving and another the reading now the…
1
vote
1 answer

Resolution of NSURL bookmark fails for an external drive in Yosemite

In my cocoa app I use the following code to create a security-scoped bookmark from an NSURL that I got from an NSOpenPanel: NSData *bookmarkData=[myURL bookmarkDataWithOptions:([NSURL…
Nickkk
  • 2,261
  • 1
  • 25
  • 34
0
votes
0 answers

Security scoped bookmark and external drives - MacOS

I'm writing a photo management app where the document stores the location of folders (in which image files reside). These are added by the user, and saved as security scoped bookmarks. All this appeared to be working. However, I tested a use-case…
Philip Pegden
  • 1,732
  • 1
  • 14
  • 33
0
votes
0 answers

Can't access contents of a Security-Scoped directory URL

I have the following code to enumerate through a directory. The URL to the directory is passed in as a parameter to the function. The startAccessingSecurityScopedResource returns true at the start of the function, however when I start to enumerate…
Saad Mahboob
  • 21
  • 1
  • 3
0
votes
1 answer

Xamarin.Mac Using security-scoped bookmarks

Microsoft's official documentation says: https://learn.microsoft.com/en-us/xamarin/mac/app-fundamentals/sandboxing#using-security-scoped-bookmarks to try to access persistent outside of SandBox, but it doesn't work. First, I use…