I'm currently creating a raycast extension for quickly opening recently opened Pages documents.
Now, I have to find a way to access the documents and their pathnames. I
tried following this answer and stumbled across
~/Library/Containers/com.apple.iWork.Pages/Data/Library/Preferences/com.apple.iWork.Pages.plist. This plist file contains a key named
TSARecentOpenedDocumentTimestamps which corresponds to an array of timestamps of when I opened pages documents.
However, when using Xcode's built inplist search tool, I could not find any arrays of recently opened file paths or names. I also tried renaming the file to
com.apple.iWork.Pages.old.plist and then quit and reopened pages. After it opened, I was faced with the "welcome to pages" screen, like when I first opened it after getting my MacBook. However, I tried going to
file -> open recent in the menu bar and found that my recently opened file names were still there, but greyed out. Therefore, the recently opened files could not have been stored in that plist.
A raycast extension exists for opening recently opened Visual Studio Code projects, so I forked the code to see how. It reads from a database located at
~/Library/Application Support/Code/User/globalStorage/state.vscdb with the following SQL query
SELECT json_extract(value, '$.entries') as entries FROM ItemTable WHERE key = 'history.recentlyOpenedPathsList'. However, while trying to find a similar file for pages, I noticed that it does not even have a folder in
~/Library/Application Support with its data.
I have absolutely no idea where Pages could store this data, and without knowing where, I can't build this extension. So does anyone know where this data is stored? Thanks in advance!