Post

Replies

Boosts

Views

Activity

Reply to `...Failed to get state for list identifier com.apple.LSSharedFileList.ApplicationRecentDocuments Error...` in console
Here's what helped in my case. What I was trying to do: Insert a file url into NSDocumentController's recent document list programmatically. It was originally opened by NSOpenPanel on an earlier run but then its path was saved to a file for opening later. My application manages the recent list manually based on its own records. What happened: It appeared in the File menu recent list, but Clear Menu remained grayed out. I got the "Insert failed for list identifier com.apple.LSSharedFileList.ApplicationRecentDocuments" error message What caused this: The application was not permitted to access the file that I was trying to insert into the recent list. What fixed the problem: I had to read in the bookmark that I saved on the earlier run, and call startAccessingSecurityScopedResource on it, before inserting it into the recent list. Even after inserting into the list, the app should not call stopAccessingSecurityScopedResource, until the item is removed from the recent list.
Jun ’23