Extract emails to a spreadsheet
Am I able to extract all the emails in my mailbox into a file? I would like the email addresses of those who contacted me
MacBook, macOS 10.15
Apple Intelligence now features Image Playground, Genmoji, Writing Tools enhancements, seamless support for ChatGPT, and visual intelligence.
Apple Intelligence has also begun language expansion with localized English support for Australia, Canada, Ireland, New Zealand, South Africa, and the U.K. Learn more >
Apple Intelligence has also begun language expansion with localized English support for Australia, Canada, Ireland, New Zealand, South Africa, and the U.K. Learn more >
You can make a difference in the Apple Support Community!
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
Am I able to extract all the emails in my mailbox into a file? I would like the email addresses of those who contacted me
MacBook, macOS 10.15
Thanks to Barney 15E & DSM...
Opened up AppleScript Editor (once I sussed out what it was)
Now this was new to me as I had never even looked at Applescript because as quoted on the net :
You can fit the people that love applescript in a small car or even a bike..
Anyway thats about as much as I can tell you about applescript..
I now have the email stored in a mailbox inside my INBOX.
This is the script I then used to get the results into Microsoft Excel:
tell application “Microsoft Excel”
set LinkRemoval to make new workbook
set theSheet to active sheet of LinkRemoval
set formula of range “D1” of theSheet to “Message”
set formula of range “C1” of theSheet to “Subject”
set formula of range “B1” of theSheet to “From”
set formula of range “A1” of theSheet to “Date”
end tell
tell application “Mail”
set theRow to 2
set theAccount to “Sales”
get account theAccount
set theMessages to messages of inbox
repeat with aMessage in theMessages
my SetDate(date received of aMessage, theRow, theSheet)
my SetFrom(sender of aMessage, theRow, theSheet)
my SetSubject(subject of aMessage, theRow, theSheet)
my SetMessage(content of aMessage, theRow, theSheet)
set theRow to theRow + 1
end repeat
end tell
on SetDate(theDate, theRow, theSheet)
tell application “Microsoft Excel”
set theRange to “A” & theRow
set formula of range theRange of theSheet to theDate
end tell
end SetDate
on SetFrom(theSender, theRow, theSheet)
tell application “Microsoft Excel”
set theRange to “B” & theRow
set formula of range theRange of theSheet to theSender
end tell
end SetFrom
on SetSubject(theSubject, theRow, theSheet)
tell application “Microsoft Excel”
set theRange to “C” & theRow
set formula of range theRange of theSheet to theSubject
end tell
end SetSubject
on SetMessage(theMessage, theRow, theSheet)
tell application “Microsoft Excel”
set theRange to “D” & theRow
set formula of range theRange of theSheet to theMessage
end tell
end SetMessage
Run the script and after a minute (depending on amount of messages) your excel sheet is complete.
Export Messages From Mail to Excel With AppleScript | Blog |DSM Design
Thanks to Barney 15E & DSM...
Opened up AppleScript Editor (once I sussed out what it was)
Now this was new to me as I had never even looked at Applescript because as quoted on the net :
You can fit the people that love applescript in a small car or even a bike..
Anyway thats about as much as I can tell you about applescript..
I now have the email stored in a mailbox inside my INBOX.
This is the script I then used to get the results into Microsoft Excel:
tell application “Microsoft Excel”
set LinkRemoval to make new workbook
set theSheet to active sheet of LinkRemoval
set formula of range “D1” of theSheet to “Message”
set formula of range “C1” of theSheet to “Subject”
set formula of range “B1” of theSheet to “From”
set formula of range “A1” of theSheet to “Date”
end tell
tell application “Mail”
set theRow to 2
set theAccount to “Sales”
get account theAccount
set theMessages to messages of inbox
repeat with aMessage in theMessages
my SetDate(date received of aMessage, theRow, theSheet)
my SetFrom(sender of aMessage, theRow, theSheet)
my SetSubject(subject of aMessage, theRow, theSheet)
my SetMessage(content of aMessage, theRow, theSheet)
set theRow to theRow + 1
end repeat
end tell
on SetDate(theDate, theRow, theSheet)
tell application “Microsoft Excel”
set theRange to “A” & theRow
set formula of range theRange of theSheet to theDate
end tell
end SetDate
on SetFrom(theSender, theRow, theSheet)
tell application “Microsoft Excel”
set theRange to “B” & theRow
set formula of range theRange of theSheet to theSender
end tell
end SetFrom
on SetSubject(theSubject, theRow, theSheet)
tell application “Microsoft Excel”
set theRange to “C” & theRow
set formula of range theRange of theSheet to theSubject
end tell
end SetSubject
on SetMessage(theMessage, theRow, theSheet)
tell application “Microsoft Excel”
set theRange to “D” & theRow
set formula of range theRange of theSheet to theMessage
end tell
end SetMessage
Run the script and after a minute (depending on amount of messages) your excel sheet is complete.
Export Messages From Mail to Excel With AppleScript | Blog |DSM Design
One can Export individual e-mail in PDF format.
There are 3000 of them so I wanted them in CSV or excel
Good luck - do not know of a method aside from Copy the email address from the e-mail and Paste into Word Processing Application or Spreadsheet Application.
Extract emails to a spreadsheet