title: How to get a list of recently opened files?
body: <p>I am currently in the process of building an AppleScript application. (Note that this is a plain AppleScript "application" created by using AppleScript Editor to create an AppleScript and then saving that script as an application). For this app, I need to know the filepaths of the recently opened files for the current user. I've tried many different methods so far, but none seem to be giving me the information that I need.</p>
  
  <p>I've tried the following:</p>
  
  <ul>
  <li>I've tried the <code>com.apple.recentitems.plist</code> file, however the filepath information contained inside this file seems to be in Hex format, which when converted into ASCII is full of a lot of mumbo-jumbo, and the format of the mumbo-jumbo seems to change for different files and on different computers.</li>
  <li>I've tried using the unix <code>find</code> command to filter files opened in the past day, however here I can only choose between recently modified and recently accessed, not recently opened. Recently modified files won't include opened files which aren't modified (like an image that is opened but not edited), and recently accessed files seems to show all files which have been visible in Finder in thumbnail view, even if they haven't been opened by the user.</li>
  <li>I've tried venturing into Objective-C and the <code>LaunchServices/LSSharedFileList.h</code> file for getting <code>kLSSharedFileListRecentDocumentItems</code> (similar to <a href="https://stackoverflow.com/questions/5205080/recently-opened-apps">this answer</a>), however I've never used Objective-C before so I've not been able to get anything to work properly with this.</li>
  </ul>
  
  <p>Any help that anyone could provide to help me to get a list of the recently opened files for the current user would be very much appreciated. Furthermore, any help with being able to write the list of recently changed files to a text file would be great.</p>