As a math grad student I often have undergrads emailing me homework to be graded. Some undergrads do send me homework in PDF format. On the other hand many don't and it is very tiresome to convert their homework in image files into PDFs manually either online or using my simple Python script using img2pdf.
I would like to be able to
automatically download attachments that look like homework (i.e. the email has "HW", "Homework", "hw" or "Hw",
and there exists images or PDFs as attachments)
and then if images are obtained combine them into a single PDF using the Python script that I already have.
Adding a new option in the Mail app that can convert attachments to PDF using my Python script will also be great.
I think AppleScript can handle the issue of saving attachments. Can it also execute a Python script?