Here are detailed instructions on how to use this latest version to export emails into a .CSV or .TSV file:
Open a Script Editor app window (Click on an empty area of the Mac desktop so that no app window is currently active, then on the taskbar at the top of the Mac desktop select Go > Utilities > Script Editor). When a new empty Script Editor window opens, copy&paste the script into the window.
Open a Mail app window (Click on an empty area of the Mac desktop so that no app window is currently active, then on the taskbar at the top of the Mac desktop, select Go > Applications > Mail. If you have difficulty getting the Mail app window to open or if desired emails are not showing up in the Mail app, on the taskbar at the top of the Mac desktop, use Mail > Accounts... and select the desired account on the right or press the + sign at the bottom of the Internet Accounts window.
Once the desired emails are showing in the Mail app window, select the emails to be exported. Best to first select only a few emails and confirm that the script works properly before running it on a large number of emails.
You can use search to find selected emails based upon keywords, but best not to search in "All Mailboxes". Instead, best to select a folder (eg, Inbox) and search within that folder. If "All Mailboxes" is searched, the 'Mailbox folder' column in all rows of the exported .CSV or .TSV file are going to contain "Import", no matter what folder the selected emails are actually in and even if the selected emails are all in a single folder.
In the Script Editor app window, click the run button and watch the Running... indicator. If there are more than a hundred emails, the script can take many minutes to finish. If the script fails with a "Numbers got an error: Invalid row count.", then the script is not seeing any emails selected in the Mail app.
When the script runs successfully, it opens a new Numbers app window and writes the results into that window. When the script finishes, look for the new Numbers app window or open the Numbers app from the app bar that pops up from the bottom of the Mac desktop when the cursor is moved there. With Numbers app window active on the Mac desktop, use File > Export To > CSV... to save the result in .CSV format in the directory and file of your choice. (There is also an option to save the file in TSV (Tab-Separated Value) format, which is often a better option than CSV format.) Then, close the Numbers app window and click Delete if you don't want to save the result in spreadsheet format.
The Accounts... window in the Mail app suggests that it can be used to access emails on many different email servers (iCloud, Microsoft Exchange, Google Gmail, Yahoo Mail, AOL, and perhaps others). If that is true, then the attached Apple script can be used to extract emails from all those different servers. That is, of course, a big if. As we all know, despite Apple's mantra, Apple software often doesn't just work! 😣