RecentItems menu?

What is current best practice for a Recent Items menu that still works when the files get moved?

Would keeping aliases / shortcuts work?

If you app is “sandboxed” you will have issues… no matter what…

In my non-sandboxed apps, I keep the native path… and on startup I remove from the list any file that no longer exists… so if the user moved it, they have to add it back themself

Yeah, but that is sooo unMaclike …

I always hated with PowerPoint that people would have all their pictures missing because they “cleaned up” their desktop or moved the presentation there. Not what I’m after …

… though if it is not found at least I can bring up the Open dialog box and they can do a spotlight search to look for it …

… or if I save the date and time as well I could do the spotlight search and say that the original file has moved and present the option to open any found file …

Apple provide API for managing a Recent Items menu. I have exposed the API and Xojo code for this in the latest release of the Ohanaware App Kit.

If you use the Apple supplied API (or Document based app template in Xcode) it does work. I’ve been using it for several years with Sandboxed apps in the Mac App Store.

Only thing I guess is my understanding of “document based app” … What I need to do it load/save in the background a file that is not “document” per se. All the Xcode examples I have found relate to some version of a text editor or such… In my app, the user never “sees” the file… just the interactions based on its contents …

I need to pass a string to create the equivalent of a folderitem, load the contents of the file specified… The path string would be saved in a pList type file

If you have such an example I’d love to see it

What about databases (as my data are stored in databases)?

exactly my situation…I can’t see how NSDocument applies

If you create a document based application, all file handling is done via NSDocument, and that’s where Apple keep their secret sauce hidden.

In your Xcode project you see very little, it’s what goes in the background (that’s opaque to the developer) that makes all the difference.

It took me months to track down exactly what “AppKit” does behind the scenes, and then to get it to work in Xojo.

They will work, but if you’re using a Sandboxed application, I would advise looking through the forums to figure out how to handle the SQLite WAL file (I think it’s this file that’s incompatible with the App Sandbox), which according to Apple is seemless, but when I last tried it (years ago) it still had issues. I think Apple means the SQL temp files are okay, when using Apple’s CoreData.

I used SaveInfo (in both read and write) in a project, but I do not checked (moved) a recently opened file to be positive and say “it works !”.

El Capitan / Xojo 2015r1.

The app probably needs to be sandboxed to see the issues