In episode 25 of Automators David and I sat down together in person, with the help of his suitcase and some shoes, we were able to record a full episode in person! Continue reading “Automators 25: WWDC 2019 Automation Update”
In episode 21 of Automators, David and I were joined by the lovely Dr Drang! You may have heard him on a few other podcasts, including Mac Power Users. Continue reading “Automators 21: Invoicing, Writing, and Regular Expressions with Dr. Drang”
In the third episode of Automators we are joined by Sal Soghoian, AppleScript God, to learn about AppleScript and how to use it!
While David and I usually take it in turns to write up everything about the show and provide complete documentation, Sal’s actually done that for this week:
You can find the scripts, videos, and a complete breakdown of everything over at macOSautomation, along with all of Sal’s other things.
In this show Sal gave us 3 AppleScripts. The first takes a whole table, and converts it into a bar chart in Keynote, the second takes a row or column and makes a pie chart, and the final one takes selected rows and turns them into a chart.
The brilliance of this, is the first script is just 17 lines – that’s it!
This week’s episodes of The Automators is focused on calendar event creation. There are many ways you can automatically create calendar events, and it’s useful to be able to do so, to avoid losing information. You can also use calendar events as a trigger to do something – which we cover towards the end. Below there are details of all the automations we cover, including 4 (really, four!) screencasts.
Workflow: Calendar Event Templates
This is a very simple Workflow which asks me for the date and time of the event, and then what kind of event this is (the demo has 3 examples) – it then adjusts the time to add an appropriate length for the appointment and adds it to my calendar. This is very useful because I can never remember what floor my dentist is on or exactly where to turn to find my hairdresser – so I can add this to the notes. Even if the places you frequent are not hidden like mine are you can still use this!
You can get the workflow here: Calendar Event Templates Make sure to read on to find out about the “Run Workflow” action at the end of it.
Workflow: Add Event To Work Calendar
This workflow follows the first one, and is in fact run by it – or could be. It simply asks you if the appointment you’ve made is during working hours, and if you say yes, adds an event that starts half an hour before and ends half an hour after the appointment you’ve just created to your calendar. Make sure to tweak the calendar setting here! You can get the workflow here: Add Event To Work Calendar (Menu)
Of course, you can automate this too, this formats the date of the event as one letter (so Monday becomes M, Friday becomes F), and if it’s not Saturday or Sunday, checks if the event starts after 8 am but before 6pm – if yes it adds an event to your calendar. It’s not insanely complicated, but it’s not as simple as the Workflow above.
You can get the workflow here: Add Event To Work Calendar (Auto)
David’s Hyper Scheduling Workflow
Since February David has had an ongoing Hyper-Scheduling Experiment, which involves scheduling blocks of time in his calendar to provide a framework throughout his day. You can see his Workflow to generate some of the core blocks here.
You can get the workflow here: Block Schedule
Add Travel Time
You can get the workflow here: Travel Time
Of course, one of the simplest ways to automate calendar event creation is repeats – and you can go from very simple up to fairly complex within that. The simplest repeats are every day/week/month/year, but if you go into the
Custom... options then you can create repeats such as “On the first weekday of every month”.
Copy and paste
If repeating events count as automation (they do!) then copying and pasting events does as well.
CMD+Dallows you to duplicate an event, and then you can drag and drop it.
CMD+Vlets you paste, if you select a new date before you paste then the event is automatically added to that day. In many apps you can even paste it in at the time you have selected.
- Fantastical on iOS gives you the option to duplicate an event when you tap and hold on it, or when you swipe, and tap “More…”, BusyCal allows you to duplicate an event by force touching it. I personally prefer Fantastical as it immediately asks me for the new date where as with BusyCal you need to edit the new event.
Workflow: Copy a Calendar Event
This Workflow lets you choose from calendar events, and uses the chosen item to create a new event. It is currently set to use events from today, but you can easily change the filter in the “Find Calendar Events” action to look in the last week, the next week, or any time period of your choice.
You can get the workflow here: Copy Calendar Event
Parsing a list of events with Numbers
I first mentioned this automation in episode 418 of the Mac Power Users, this is designed to help you take a list of events and quickly add them to the right calendars. As David mentioned on the podcast you could also use it to calculate dates backwards from a specific event (he used a trial as an example) to add other events or deadlines to your calendar.
You can download the spreadsheet here.
The Keyboard Maestro Macro is very simple, it splits the text on your clipboard into lines, and then runs the following AppleScript on each line.
tell application "Keyboard Maestro Engine" to set myEvent to getvariable "Event" tell application "Fantastical 2" parse sentence myEvent with add immediately end tell
This AppleScript merely sets a local variable to the Keyboard Maestro variable for the line, and then uses Fantastical’s AppleScript support to get it to parse the event and add it straight to your calendar. If you wanted to evaluate each event before it gets added then you would remove the
with add immediately.
You can download this Keyboard Maestro Macro here
You can also make this system iOS friendly in two ways, the Numbers sheet itself of course works on iOS. But you can do two things with the list of events it generates, the first is to use a Workflow, Clipboard Events To Fantastical which goes through all the lines on your clipboard adding them to Fantastical for you. The second way is to use Drafts, with the Events in Fantastical action provided by Agile Tortoise.
As mentioned in the show, David has a great series of video tutorials for Fantastical where he guides you through the core features and some of the syntax options.
Adding event with AppleScript
As we mentioned in the show, AppleScript is not the most flexible when it comes to adding events to your calendar. However it is definitely possible! I highly recommend the official Apple documentation as a starting point for a script that works, There’s also a library called CalendarLib which is linked on the very helpful macosautomation.com.
Of course, you can also use AppleScript to control Fantastical – as demonstrated in my Keyboard Maestro Macro above, here’s their documentation for integration with other apps.
Cloud Based Automation
Using web services like IFTTT or Zapier to automate things based on calendar events can be limited if you’re not using the “right” calendar system – so you can have IFTTT trigger things based on an event starting in Google calendar, but not in iCloud calendar. You can however use a variety of triggers from time and date, to RSS feed entries, to add events to your calendar on almost any system – as long as if it’s iCloud you have the IFTTT app installed.
In this last part of the show we talked about our two favourite automations related to calendars.
David – Meeting Confirmation
This workflow is really useful if you have meetings that you need to remind other people of, David actually has two – one for in person meetings, and one for scheduled calls. You can get them here:
Rose – Workflow: Event Review
I use this Workflow to help me review the events that have happened in the last week, as well as to prepare tasks for appointments in the upcoming week. This adds the calendar events from last week to a Drafts note, and combines any tasks you note down for the next week into Taskpaper and adds them to Omnifocus.
You can get the workflow here: Event Review