Using Automator

Joined
Dec 19, 2012
Messages
2
Reaction score
0
Points
1
Location
Vienna
Your Mac's Specs
Novice
Dear forum,

I've been trying to get Automator to do a series of tasks for me but I'm having some difficulty and I've hit a brick wall. Here is what I would like to do:

I get mails from a website where my students do grammar quizzes and the mails are exactly like this:

The A vs. An Quiz 2 was completed by Ray Stevens:

Final Score: 10/10

Student Comments:

What I currently do manually is input this data in a simple numbers spreadsheet with the following columns:
NAME; QUIZ; DATE; RIGHT ANSWERS; TOTAL QUESTIONS; % (formula)

I then wait til a student has about done about (another) 10 quizzes and then send them a normal bar chart showing the names and results of each test they have do so far.

This is all quite simple, but as the number of students increases, it takes up more and more of my time. I would therefore like to try to automate this task, meaning get Automator to:

Find the respective mails in the Mail programme,
Copy/export/steal/borrow the info that should go into the numbers spreadsheet,
(if possible) Send my students an email with a graph of their results.

Any and all help would be greatly appreciated :)

Thanks
 
Joined
Sep 30, 2007
Messages
9,962
Reaction score
1,235
Points
113
Location
The Republic of Neptune
Your Mac's Specs
2019 iMac 27"; 2020 M1 MacBook Air; macOS up-to-date... always.
I have a pretty fair grasp of Automator, but this seems beyond what it can do. Perhaps not beyond it, but insidiously complex and highly prone to errors. Here's a rudimentary idea of what I think the workflow would have to do:

  1. Copy contents of email.
  2. Paste into a text editor (i.e. TextEdit).
  3. Find the text " was completed by " (no quotes, with those spaces) and insert a RETURN character to put the name on a new line.
  4. If desired, also strip the first four characters of the first line so that "The A vs..." field now says "A vs ...".
  5. Find the text "Final Score: " and strip that.
  6. Find the "/" character, strip it and insert a RETURN character.
  7. Find the text "Student Comments:" and strip that.

Once done, you should have five lines of text matching what your spreadsheet column entries would be, though not in your preferred order. From here, the question is how to put it in the spreadsheet itself. That's a whole new challenge. I'm not familiar with Numbers and I haven't even used spreadsheet software in a couple decades, but you could probably continue to modify those lines above so that they are "tagged" as belonging to a specific column using XML code, then save it as an XML file and import it to Numbers.

There ultimately "may" be a better solution from this website that sends you these results. They should already have all this data available in a format that Numbers could import directly. Your email is simply a human-readable report of that database's output, similar to what you could set Numbers to generate (I assume). Is there any chance you can have the website start sending you these results in an XML file instead? That would greatly simplify things.

EDIT: Besides Automator, there are other macro tools available that can pull off feats like these. Keyboard Maestro in particular is especially good and more capable than Automator in some ways.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top