Feedback on a potential 'Magic Templates' script


After working on a script to meet some very specific needs of mine, I realized that I could adapt my work to be useful in a wider range of use cases. I thought I’d post my plan here to get some feedback before creating this script. Here’s what I had in mind…

This script would insert at the selection point an outline based on a template stored in a separate document. That template can include regular static items as well as the following special tags:

  • @copyRoutine - creates a list depending on the day of the week.
    • It grabs these lists from a special “Routines” document that supports the following day-dependent project lists: ‘Default’, ‘Weekday’, ‘Weekend’, ‘Sunday’, ‘Monday’, Tuesday’, etc.
  • @copySearch('query') - creates a list by copying the body text of all items matching the provided query (in the document from which the script was called).
  • @copySearchDeep('query') - Same as above, but also copies the children of the items matching the search query.
  • @copyEvents('query', 'Formatted Text') - creates a list from events that match the provided query.
    • ‘Formatted text’ specifies the format of the body text for the item created for each event. Here, the special keywords SUMMARY, DATE, START, END, CALENDAR would be replaced by the corresponding event property. For example, if you provide “(START) SUMMARY @remind(START - 20 minutes)”, it would output something like “(10:00 AM) Econ 101 Lecture @remind(10:00 AM - 20 minutes)”.
  • @copyReminders('query', 'Formatted text') - Creates a list from tasks that match the provided query.
    • ‘Formatted text’ behaves as above, but uses the keywords NAME, BODYTEXT, LIST, DUEDATE, REMINDERDATE.

This should provide a lot of flexibility and create a nice general way to quickly create lists to meet your own specific needs. Would you find this useful? Think the above plan could be improved? Any other special @copy... tags that I should include?

'Magic' daily planning script

I’ve played a bit with the original version of the script, and I really like where this is going. I generally have a @today tag for, well, today tasks, as well as a @now tag for high priority/time sensitive tasks. It’s unclear to me if your current scheme would support creating two different sections for those, but I think it would, which would be important to me

One thing I would like to see, but I’m not sure how feasible it is: being able to list calendar entries based on specific calendars. Right now my “today” includes all of the calendars I’m subscribed to, and I really don’t need to know that my partner is going to their day job every day (e.g.). This is an issue I’ve seen with every piece of software dealing with Calendar, so it may be beyond the scope of your script, but it would be handy to have.


Thanks for the feedback!

As I’m now imagining it, a single run of the script should be able to create both a ‘Today’ project and a ‘Now’ project. You’d just include both project templates in a single template document.

And the plan is to support arbitrary calendar queries. So you could include something like @copyEvents(‘events from my work calendar occurring today’, ‘(START) SUMMARY’) to pull in only work events. And you could construct a similar tag to pull in events from your personal calendar elsewhere in the template.

At least, that’s the plan. I still have to figure out a way around the calendar querying problems that came up with my current script, but I know it’s doable.


Sounds great. I’m really looking forward to it!

I think I may have just found a bug (or at least a thing that will confuse people): If I run the script without an extant “Today” project, it just fails silently. That took a while to figure out :slight_smile:

EDIT: I just read the other thread where someone else reported this already. Please disregard!


Looks like a great thing and might solve one thing that I run into:

I’d like to have an agenda view myself, containing tasks

  • that are overdue, due today or marked as @today
  • tasks that are due the next week
  • all high prio tasks
  • next actions

At the moment I have different searches for that and go over them one by one. I have the feeling that your Script will just solve that - so I’m very corious about the release!


I’ve been using this script for a few months and love it, but just came across a problem I hadn’t encountered before: if you have no events scheduled in any of your calendars, then the script will fail with a workflow error. (There is no error handling for the eventsText variable at the beginning of the script).

Just wanted to report that in case folks are still working on this. And thanks for the great contribution to TaskPaper!