Good morning all. I was hoping for a little help troubleshooting my script to save downloads from Airmail. I’m running Airmail 3 on a Mac Mini server at home to help automate things while I’m on the road. I’d like it to automatically grab certain attachments and toss them into a folder for Hazel to do the rest. I’m trying to move away from using my inbox as a todo list. So ultimately, I’ll want the Hazel action to put a task in Omnifocus where it belongs.
Here’s the script.
property DOWNLOADS : "~Library:Mobile Documents:iCloud~it~bloop~aimail2:Documents" on processMessage(theMessage) try tell application "Airmail 3" repeat with anAttach in mail attachments of theMessage set aFilename to filename of anAttach set aFile to quoted form of aFilename set fldr to quoted form of DOWNLOADS do shell script "cp " & (aFile as text) & " " & (fldr as text) & "" end repeat end tell end try end processMessage
Questions (this is my first real applescript, and some was harvested from various web sources.)
How do I save this (Compiled or Text) for use in an Airmail Rule?
Do I need to reference the object mail attachments, or just attachments? For my education, how would I normally decide that?
The rule doesn’t work. Nothing ever appears in my iCloud folder. Any help would be appreciated. Perhaps I’m fundamentally making an incorrect assumption.
Also - I’ve seen many folks who use the Apple Mail app on the home server for this task. Are there distinct advantages to that route?