Automators 5: Project Templates


#1

#2

So that’s how it’s done! Thanks for saving my bacon. Now my Drafts workflow can work more smoothly with this screencast demonstration,


#3

I hope it’s okay that I share some project templates here that I use often :blush:

I spend a great deal of my day working on different projects in Xcode. Many days I’ll create new projects because I’m starting up something entirely new or because I need to make a prototype of something, for example a new component for a user interface. I always configure the project in a certain way and there’s some files I always create.
So when I think of project templates, I quickly think of Xcode project templates that makes it faster for me to create new projects or new files in an existing project.

Last year I wanted to automate this, so I started looking into how I can create my own Xcode project templates. Apple provides little to no documentation on this but I found this document on GitHub which helped me a lot:

Then I found some project templates others had made in various corners of the internet and pieced the information together so I could create my own templates. I thought I wanted to share some of my templates in case anyone else spend a lot of their time in Xcode and wants to create their own templates.

Xcode will look for the templates in the ~/Library/Developer/Xcode/Templates directoy. This directory may not exist in which case you should create it. I suggest intalling your templates by placing them in the directory you typically put your projects in. For me that’s ~/Developer. Then you make symlinks to your directory in ~/Library/Developer/Xcode/Templates. This way you can keep your work separated from the directories Xcode depend on. The installation script in the ZIP archive can create the symlinks for you.

Download the project templates here.


#4

Thanks for this episode. This is great to get started on project workflows.


#5

Actually I think there’s a better way of handling Things project templates that requires very little bit of fiddling: just using Things update-project URL Scheme with the Duplicate parameter on. Link

You can create an Area called templates and create a bunch of them there (setting them to Someday will help decluter). Headings and all those cool features are supported, just like any Things project. That goes waaaaay further than the AppleScript implementation linked at notes (which is kinda old).

From there, you can manage it either from Workflow or Keyboard Maestro and have Things create packing lists, client checklists or pretty much everything you can imagine and turn into a reusable checklist.

You can even precede the URL scheme command with some RegEx and go even further with checklist customizations. I have a Workflow/KBM that fetches dates and places from emails (RegEx) and set deadlines for conferences I need to prepare myself to.

It also can be tied up to create different projects via the same command (e.g. conference prep and packing list for the trip).


#6

I learned a lot from this episode, such as using the natural language processing in Omnifocus to handle date math (instead of Workflow and Applescript computations) and the Replace Text workflow action.

I heard some concern about the low viewership on the Automators videos. I want to express my support for the effort you both put into providing the supplemental material, including the videos. It is often so much easier to listen to the podcast than it is to view the videos (with my computer in front of me). I usually try to set aside some focus time to watch the videos, like a rainy weekend! Here in Colorado, we don’t have many of those in the summer! Please keep up the great podcast and supplemental work - they are both tremendous resource for our community! Thanks for all the great work!


#7

Agreed. When I start to do my exercise on a static bike I’ll be looking for videos. Yours will be at the top of my list.

Right now, while I am still running outside, I think I’ll stick to the audio podcasts… :slight_smile:


#8

I just want to express my appreciation for this episode. I’ve been using the Chris Sauve templates.scpt on my Mac for years, and it is great. But it’s macOS only. This podcast - and the associated videos - gave me the motivation to switch over to a Drafts/Workflow model.

The only irony is that now it doesn’t work on macOS! Hopefully, we will have a future solution in the form of Drafts for macOS, or Omni’s javascript automation solution.


#9

If you check the show notes there’s a link to a guest post I wrote which is the iOS counterpart to that script! :slight_smile:


#10

I echo the comments of my fellow podcast listeners. Since the Episode 1, i’ve been inspired to do more with Workload. I’m currently working on one that takes into account several things I’ve learned over the last few episodes, scouring this forum and bouncing back and forth between here and Rosemary and McSparky’s websites. The videos are a great addition to help connect the dots. For me, visuals can make all the difference. In the immortal words of Journey, “Don’t Stop, Believ’n…” in the video approach and the value it provides to round out the podcast.

P.S. apologies in advance for the ole man reference to a once favored, ICONIC band and butchering of their lyrics!


#11

Journey’s an “old” band now?! Seems like only yesterday …


#12

Only if you forget the intervening years. :slight_smile:


#13

To be clear, the videos that David was referring to are the supplemental materials demonstrating stuff from the podcast. They are not a video version of the podcast. So you’ll still be listening to the audio podcast,


#14

This episode was great. I’ve now got several templates set up in Drafts ready to populate OF. This is awesome. Going to save so much time. Thank you for the videos, too, because they made it so much easier to figure out.


#15

@DomBett

Just curious what you use your templates for? It’s interesting what people use them for. I need to make some.


#16

I was hoping someone may have insight. I loved the show, and have spent the last two days fiddling with AppleScript (just like the comic says). However, I have a slightly different use case.

I need to template a class syllabus for all the work I have to do. Does someone have a good way on how to make a list of OmniFocus tasks based on:
Date - Lecture topic - HW #'s dues
spreadsheet/table?

EG. OF Task: “Prep LECTURE TOPIC” defer Date -2
“Grade HW # Dues” Date +2
Etc

Most templates run through EVERYTHING once. I need to run four or five actions on one table line.

Many thanks!!!


#17

Inspired by this episode I decided to mostly reinvent this wheel as I wanted;

  • an iOS template expansion mechanism where I only needed a single workflow for all my templates.
  • a prompt based variable mechanism similar to the one in the Editorial app.
  • for my templates to live in OmniFocus and to process them with the share sheet.
  • for there to be a way to specify the variables and destination folder in the template itself.

https://workflow.is/workflows/a4176c0b08cb4173bf18fd64e11d4539

The following is from the comment in the workflow, hope it makes some sense:

This workflow is an action extension that expects to receive a project, task or task group shared from OmniFocus. The source can contain variables which the workflow will prompt for values. Finally the resultant project is sent back to OmniFocus with the values expanded.

The first line (e.g. the project name) must contain some special text enclosed in <<…>> e.g:

My Fancy Project Template<<V1,V2,V3|Folder>>

The V1, V2, V3 are comma separated variable names, and Folder is the name of the folder into which the final project will be placed. No folder path is necessary, “inbox” or “projects may be used”

Variable usage in the project is of the form:

${V1}

where V1 is specified in the list of variables on the first line of the project.

Tips:

  • You can leave your template project paused, the expanded project will be active.

  • Add taskpaper directives to the end of a line like @due(+1d).

  • Make tags a variable with @tags(${TAG})


#18

I was inspired by the article linked in the shownotes “Create Travel Checklist with Applescript in Things” to re-create it for Omnifocus, which I was able to do. But because I take different kinds of trips, I made several different scripts (I supposed I could have conditionals and branching to keep it as one script, which I may eventually do), so now I have Warm Domestic Travel, Cold Domestic Travel, Camping Travel, etc.

What I wanted to do was create due dates based on the date of departure, where it automatically calculate certain steps backwards from then, but it requires Applescript date math which is beyond me at the moment.

I am having fun with automating Omnifocus templates though.


#19

I do several different episodic podcasts on TV shows and movies, and each episode of the podcasts has a set of steps involved, which varies. For example, creating database tracking record (I use AirTable), scheduling the recording, changing the episode status, creating an Evernote note for my show prep, watching the TV show or movie, the recording itself, getting the audio files from the other panelists, and so on. Every project has 20 or more discrete tasks involved.


#20

If you’re adding a TaskPaper format then there is fuzzy date parsing in that - does that help? It would be awesome if you could share (one of) your scripts as a thread!