Wolfram , thank you. But I got the open recent working in my program.
My only problem is with SandBox and loading a file without using an OpenDialog. This means I have to use BookMark with SandBoxing
and my brain hurt trying to make this work in my program
Trying to translate this to PB
NSError *error = nil;
NSData *bookmarkData = nil;
bookmarkData = [openPanelFileURL
bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope
includingResourceValuesForKeys:nil
relativeToURL:nil
error:&error];
You can now store this bookmark (which is just a NSData object) in any way you choose, as long as you can retrieve it later.
When you want to access this file you need to convert the bookmarkData into a file URL:
NSError *error = nil;
BOOL bookmarkDataIsStale;
NSURL *bookmarkFileURL = nil;
bookmarkFileURL = [NSURL
URLByResolvingBookmarkData:bookmarkData
options:NSURLBookmarkResolutionWithSecurityScope
relativeToURL:nil
bookmarkDataIsStale:&bookmarkDataIsStale
error:&error];
The URL returned includes a “security scope” appended to it (although this cannot be assumed):
file://localhost/Users/ObjColumnist/Desktop/File?applesecurityscope=373861333331353430643963323736623939346438646161643134663339363061396361306534303b30303030303030303b303030303030303030303030303032303b636f6d2e6170706c652e6170702d73616e64626f782e726561642d77726974653b30303030303030313b30653030303030323b303030303030303030306535363566373b2f75736572732f7370656e6365722f6465736b746f702f77617463686564
You then need to tell the OS that you are going access this file URL:
[bookmarkFileURL startAccessingSecurityScopedResource];