I'm a new user to Automator.
I must be doing something obviously wrong, but I can't figure it.
Ultimately what I'm hoping Automator can do is to identify particular email messages in Apple Mail (by matching from or to or subject criteria), strip attachments from a message which meets the criteria, save both the attachment and the accompanying email (minus the attachment) to a folder, decompress the attachment if it is a zip file, then delete the original message.
I'm stuck at about step one.
Firstly, in Automator, I've created an action using "Find Mail Items", found in the Automator library. I program this to find Mailboxes whose Account Is WGC Admin. Then I add a condition that the Name is equal to INBOX. I added this condition because without it the results included three mailboxes - INBOX, Drafts, and Deleted Messages. I'm only interested in messages within the INBOX.
When I run this action, it seems to work okay. I get a green tick, and the Results window displays a mailbox icon labelled INBOX.
I then add an additional Action, another "Find Mail Items". I change the Find option to Messages, and set Subject Equal To WGC Contact Us Submisson, because I am interested in only those messages which contain that subject.
Now when Run the Workflow, I get 165 items as a result in the 2nd action. Yet I know that there are only 5 matching messages in the WGC Admin inbox. Nothing in the Trash.
Why does this happen?
If however I delete the first Action, and run the 2nd Action as a sole action, I get the correct 5 items.
Furthering the test, I drag the Action "Get Attachments from Mail Messages" into the right window, and beneath the 'Find Accounts In Mail" Action. I know that of those 5 messages, two of them have attachments. When I check the nominated folder to where I want the attachments saved, there is one there. But one is missing. The log of the "Get Attachments from Mail Messages" Action tells me that "A file could not be saved", but gives me no clue as to why not.
Can anyone help me with these first two problems?
Many thanks, Steven |