I am trying to copy the contents of a bill that comes in, use Regex to copy the specific cost, and then insert that into a variable. So far I am having trouble finding a way to get the content of a Mac mail message. I tried AppleScript but it's a little over my head. There is probably a slow and clunky way to do it with hotkey commands but wondering if anyone knows a way to copy the contents directly?
Awesome! Works great. I even played around a little to copy it to clipboard (a big feat, I know).
The only thing is I would like to direct the bill message to a specific mailbox and have the script run when the message hits the mailbox. I know there are rules that can trigger an AppleScript, but is there a way to set the message to be copied if it is not directly selected? Tried a few things but no such luck so far.
Please create a new topic for this request.
You can easily do that by clicking on the link icon/button at the bottom of your reply.
This will create a new topic with a lnk back to this topic.
On the upside, after this I learned quite a bit of AppleScript and it's been really gratifying. This particular project didn't end up exactly as I wanted to but of course AppleScript has been useful in other ways.
You used to be able to have a rule that worked on a per message basis, but that has been soundly broken for many years.
However – you can run an AppleScript in a rule – so you can filter all your desired mail to a process-me mailbox and then use a follow-on rule to tell Keyboard Maestro to run a macro to process those emails.
I was able to run this in a rule with no problem:
display notification "APPLESCRIPT MAIL RULE RAN!" with title "EUREKA!" sound name "Tink"
AppleScripts that run in Mail Rules must be in this folder: