Recent files for M$ Office 365 applications seem to be stored in a file named MicrosoftRegistrationDB.reg.
I found some sqlite3 shell scripts on the internet to parse it, but they don’t work here.
Does anyone know how to read this SQL file to extract/remove all recent file references from it?
SQLite Lib2 and SQLite Lib are libraries for fast and efficient SQLite programming from AppleScript, based on the well-known open-source FMDB Framework. If you ever need to access SQLite databases, or need a simple database for your scripts, one of these is the answer. Functionally similar, SQLite Lib2 requires macOS 10.11 or later and includes a terminology dictionary, whereas SQLite Lib uses traditional handlers, and works under macOS 10.10 and later. Note that scripts using SQLite Lib and SQLit Lib2 cannot be edited in Script Editor in Mojave or later because of security settings. You need to use Script Debugger. See Catalina Security and Script Libraries for Catalina installation details. (Updated July 17, 2020.)
set thePath to quoted form of "/Users/me/Library/Group Containers/UBF8T346G9.Office/MicrosoftRegistrationDB/MicrosoftRegistrationDB_xxxxxxxxxxxxxxxx.reg"
set theQuery to " \"select * from HKEY_CURRENT_USER_values where node_id in (SELECT node_id FROM HKEY_CURRENT_USER_values WHERE name='DocumentUrl');\""
set theString to do shell script "sqlite3 " & thePath & theQuery
Can we add some code to the query to get the DocumentUrl values only?
(I’m able to parse it with an Applescript regex search but it will be fun to learn the “shell way”!)