The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Applescripts: Better Templates, Complete Tasks From Mail.app Sender, and Batch-Defer (http://forums.omnigroup.com/showthread.php?t=27875)

pxldot 2013-01-19 08:35 AM

Applescripts: Better Templates, Complete Tasks From Mail.app Sender, and Batch-Defer
 
Hello all,

I have been working on a few OmniFocus Applescripts and I figured I would share them here.

[B]Templates.scpt[/B] looks for a "Templates" folder (or prompts you to select a folder where you store template projects), and then gives you a list of projects in that folder to create a new instance of. It then creates a copy of the project, sets the project's status to "Active", and moves it to a folder of your choosing. Variables are defined using a symbol of your choosing (default is "$"), and the script will replace any instances of those variables with replacements of your choosing (including variables in the project name and the tasks' names, notes, and contexts). Finally, you can define a relative date in the note of the template project (for example, "start: today + 3w at 2pm" or "due: 5d 14:30") and the script will automatically assign the calculated date to the due/ start date of that item.

[B]Mail Complete.scpt[/B] is run from Mail.app. It detects the senders of selected messages and looks in your OmniFocus library for tasks with a "Waiting For" context that includes the name of that sender. It then offers to automatically complete any selection of the tasks it finds in a dialog without having to go to OmniFocus.

[B]Later.scpt[/B] will defer all selected tasks by a user-defined amount of time. You can set either the start or due date, and the time to defer it by can be defined using any of the smart date syntax you usually have in OmniFocus (for example: "2d 5pm", "3w 14:00", "Jan 30 4am" all work).

The most recent version of all three are on the "Projects" page of my website, pxldot.com/projects. I would post them (or links to download them) here, but this is my first post so it's not letting me. Hope some of you find these useful! Let me know if you have any questions about them.

(Link added by moderator: [URL="http://pxldot.com/projects"]pxldot.com/projects[/URL])

Lizard 2013-01-22 05:37 PM

Welcome to the forums! Someone here just linked me to your scripts recently. I hope you don't mind me editing your post to include an actual link.

gazt 2013-01-23 12:10 AM

Welcome!

I just wanted to thank you for your scripts, I think that the template script is just amazing! I donīt know how to thank you enough for that.

May I raise a thought about that script?

Would it be possible to also activate the use of locations in the script?
Imagine for example that iīm going to attend to a conference in a few weeks. In the notes in the templateproject I added the due time for the conference, and itīs name as variables for the script to change - that way I have a nice template for tasks I have to do before the conference begin. But could I use the script, to activate the tasks I want to do after the conference have ended, when I reach a certain location (like my office for example).

(I hope that you understand, english is not my first language. Also I hope that I donīt offend you in any way asking this question).

Great work anyway
Kindest regards/G

gazt 2013-01-23 03:07 AM

I also wonder if the possibility to subtract from any variable is written into the script (eg. time from start/due date).

I tried this morning to set $date as one variable in the projects notes, and either add days in the task note (ex: start: $date + 2d, Due: $date 09:00) or subtract days (ex: start: $date - 2w 09:00). I only success when Iīm adding days to the $date variable, and get no result with the subtraction. If I use the conference example above I could add the due date from the $date variable in some tasks, while other ones (like booking room and travels) I would like to automate so the task start for example 8w before the conference starts (eg. the $date).

Anyone that have any thoughts about that?
All the best

pxldot 2013-01-31 09:48 AM

[QUOTE=gazt;119526]I also wonder if the possibility to subtract from any variable is written into the script (eg. time from start/due date).

I tried this morning to set $date as one variable in the projects notes, and either add days in the task note (ex: start: $date + 2d, Due: $date 09:00) or subtract days (ex: start: $date - 2w 09:00). I only success when Iīm adding days to the $date variable, and get no result with the subtraction. If I use the conference example above I could add the due date from the $date variable in some tasks, while other ones (like booking room and travels) I would like to automate so the task start for example 8w before the conference starts (eg. the $date).

Anyone that have any thoughts about that?
All the best[/QUOTE]
gazt, thanks for the idea —*I have now added a special date variable that can be used in the way you are describing. You can grab the most recent version of the script with this built in from the link in the original post.

gazt 2013-01-31 12:30 PM

You are amazing! thank you

I moved the first template script away from the script-folder and renamed this last version, so I knew that I tried the right script.

Unfortunately when I tested it, there was no difference now from the first version of the script. When I tried to subtract, using $date in the notes as well in title, or the ask-command (tried with both $ask and just ask) the script worked just as before. I donīt know if this have something to do with that I still uses OS x 10.6.8? or if I misunderstood your instructions.

Like the last version I also canīt use w (week) or y (year) as datevariables - only d (days). Anyone more that faces the same problem?

Keep up the good work, still an awesome script. Iīm just sorry that I canīt add more then feedback and ideas.

kingsinger 2013-02-04 04:55 PM

A couple of thoughts on Better Templates Script
 
I've been using Curt Clifton's Templates script for a few years now. It works well. One thing I did a while ago was to put my templates in a folder with status "dropped", so that the templates wouldn't clutter up my list of active projects.

Right now, it seems like your script does not account for the possibility that templates could be in a folder with status dropped. I wonder if you might want to think about amending it so it accounts for that possibility.

In my own work flow with Curt's script, I have a perspective called templates. When I hit the keyboard shortcut, it changes the project filter to "dropped" and takes me to the folder with the templates. From there, I can choose a template, actuate it, fill it out, and then I get my new template, which I can make active and then manually move to the folder where I want it.

Your script definitely has some bells and whistles that would be nice (e.g., the part that lets you choose where to place the finished project you made form the template). But I also want to make sure I can keep the clutter down as well.

I hope these comments make sense.

Best,

KS

gazt 2013-02-05 01:52 PM

Kingsinger - Thatīs a great idea keeping the status as dropped. I also feel that it becomes "messy" with all the projects on hold, and what youīre describing (only seeing the active ones) seems very convenient. I do hope that there is some kind of template alternative in Omnifocus 2, thatīs neither dropped, active or on hold.

pxldot 2013-02-07 02:25 PM

Kingsinger, the newest version (available from the website) should work for you —*I added the ability to detect whether there was a Dropped folder with templates in the name, and to then pick a template from this folder to create an instance of. Didn't do a lot of testing on it (since I honestly don't like that approach), but I think it should work.

gazt: not sure what is going wrong, could be an issue with how you are writing everything in. If you post a screenshot of an example template project I can troubleshoot as all of the date math works on my end.

kingsinger 2013-02-08 09:27 PM

I'll give it a shot. Be curious to know why you don't like that approach too.

Thanks!

KS

kingsinger 2013-02-09 09:58 AM

Tested this out. Seems to work. One other option that would be great (at least in my workflow) is to have a choice about whether the script places the new project at the beginning or end of the list of projects in the chosen folder.

I tend to place new projects at the top of my list and then triage them from there.

Curt's script put the new project at the very bottom of the entire project list. From there, I'd typically use another applescript from this forum to move the project to the very top of the project list and then manually place it into the active projects folder I keep near the top of the list.

So the fact that your script allows the user to choose a folder is a nice improvement. But at least for me, it would be amazing if I could choose to have it placed at the top of that folder.

Best,

KS

But

whpalmer4 2013-02-09 12:37 PM

I made a modification to Curt's script at one point that offered the option of top or bottom for the insertion point of the new project. It was a compile-time option, not run-time. One thing I wanted to do but was unable to suss out was to have the growl notification of the new project creation be a clickable notification (like the due soon, due now, start now, etc. notifications OmniFocus will send) so that clicking on it would take you to the project so you could move it or snag a link to put in some document. Never did figure out the secret to success with that.

@pxldot: what don't you like about the dropped folder full of templates approach? Or is it something else you don't like? Haven't had a chance to try out the script, but it's on the list of things to tinker with in OmniFocus :-)

pxldot 2013-02-11 09:20 AM

@kingsinger: I like the idea (I prefer the new instances at the top as well). It's now a compile-time option in the most recent version (download it from the [url]http://pxldot.com/projects[/url], look near the top of the script).

@whpalmer: I may do the Growl thing in the future. Two things for the dropped folder. Out of sight, out of mind, so I think Dropped folders, which aren't often seen, makes it easier to forget about the projects and for the system to fall into disrepair. I also think it's non-canonical in OmniFocus: Dropped status indicates that you had initially planned to do it, and decided against it. On Hold means that you plan on doing it at some point. I simply think the nature of templates makes them better suited as On Hold. No need to get too theoretical, I suppose, but that's my opinion :)

whpalmer4 2013-02-11 10:41 AM

[QUOTE=pxldot;120277]
Two things for the dropped folder. Out of sight, out of mind, so I think Dropped folders, which aren't often seen, makes it easier to forget about the projects and for the system to fall into disrepair.
[/quote]
They are only out of sight when you set the view preferences not to show them. By that same argument anything that isn't a next action is at risk if you like a Next Action view, or anything that isn't available if you like to use the Available view.
[quote]
I also think it's non-canonical in OmniFocus: Dropped status indicates that you had initially planned to do it, and decided against it. On Hold means that you plan on doing it at some point. I simply think the nature of templates makes them better suited as On Hold. No need to get too theoretical, I suppose, but that's my opinion :)[/QUOTE]
Non-canonical? Here's a quote from Ken in 2007:[indent]
OmniFocus does have a notion of project status: a project can be active, on hold, completed, or dropped, and you can filter the project list using these states. You can also set start dates on projects and actions (giving you a "scheduled" state), and you can create different top-level folders for projects and use those to create your own arbitrary groupings of folders (such as a someday/maybe list, which might be a bunch of projects in an inactive folder).

[/indent]

kingsinger 2013-02-11 08:52 PM

[QUOTE=pxldot;120277]@kingsinger: I like the idea (I prefer the new instances at the top as well). It's now a compile-time option in the most recent version (download it from the [url]http://pxldot.com/projects[/url], look near the top of the script).

@whpalmer: I may do the Growl thing in the future. Two things for the dropped folder. Out of sight, out of mind, so I think Dropped folders, which aren't often seen, makes it easier to forget about the projects and for the system to fall into disrepair. I also think it's non-canonical in OmniFocus: Dropped status indicates that you had initially planned to do it, and decided against it. On Hold means that you plan on doing it at some point. I simply think the nature of templates makes them better suited as On Hold. No need to get too theoretical, I suppose, but that's my opinion :)[/QUOTE]

But the whole point of having a template script is to create new projects. Your script finds the templates and presents a list of them to you. So I don't need to see those in the project sidebar. The only time I use them is when I need to create a particular project that relates to one of the templates I've created (e.g., New Matter--W/Fee Deposit). The rest of the time, if these template projects are in an active folder, they're just irrelevant noise that's getting mixed in with the signal of the projects that are truly active. If I have contexts assigned to certain tasks in the template, they get intermingled in with the real tasks (this is particularly a problem if you are filtering on remaining tasks, which a I do a fair amount, because a lot of my projects don't always flow in perfect sequential order, so I need to see the entire overview to check things off).

Obviously, "Dropped" has a certain meaning within OF, as it relates to GTD. On the other and, if we simply abstract it out to what it does, "Dropped" simply means don't show these items unless I explicitly filter on everything or on "Dropped."

I agree that ideally templates would live in their own dedicate space in OF separate from the present filtering taxonomy. But at least for me, as things stand, dropped seems like the most logical place to keep the templates (especially in the context of your script, which does such a nice job presenting all the available templates to the user when the script is actuated).

Looking forward to test driving your updated version of the scripts. Thanks for all your great work.

KS

pxldot 2013-02-13 07:30 AM

I didn't mean to start a war over syntax/ interpretation :P Based on my interpretation of Dropped, I prefer to use On Hold for templates, although I understand that the way Dropped hides the folder/ projects is actually more conducive (in some ways) to a template folder. As with all things, I have my own interpretation of canon, and I operate on that (though I'm happy to make it an option for those that don't work the same way). I still think that a dropped <anything> means it is gone and not coming back, but I'm certainly not religious about it, even in my own database.

I'm also 100% in agreement that it depends largely on how you use OF. That's really the power behind the software —*everyone uses it in a way that better fits their mental model/ processes. I exclude my templates folder from most perspectives (and really focus on only available tasks, since I work so hard to create a good project structure on the front-end that allows me to ignore the unavailable tasks until they're front-and-center), but still want it in the main project list so that I am actively making sure the template projects aren't getting stale. To each their own!

kingsinger 2013-02-13 03:23 PM

[QUOTE=pxldot;120375]I didn't mean to start a war over syntax/ interpretation :P Based on my interpretation of Dropped, I prefer to use On Hold for templates, although I understand that the way Dropped hides the folder/ projects is actually more conducive (in some ways) to a template folder. As with all things, I have my own interpretation of canon, and I operate on that (though I'm happy to make it an option for those that don't work the same way). I still think that a dropped <anything> means it is gone and not coming back, but I'm certainly not religious about it, even in my own database.

I'm also 100% in agreement that it depends largely on how you use OF. That's really the power behind the software —*everyone uses it in a way that better fits their mental model/ processes. I exclude my templates folder from most perspectives (and really focus on only available tasks, since I work so hard to create a good project structure on the front-end that allows me to ignore the unavailable tasks until they're front-and-center), but still want it in the main project list so that I am actively making sure the template projects aren't getting stale. To each their own![/QUOTE]


Right on. I don't think anyone is looking to have a war either. But a lot of people read these forums looking for info and tips on how to use OF more efficiently and effectively, so I do think it's useful to see the underlying rationale behind different people's approaches to using the tool. I've been using OF since it was Kinkless GTD. But I continue to learn a lot of great stuff here.

Indeed, WHPalmer has taught me a lot about how to use OF better in the years I've been reading this forum (probably, he's the person who explained that putting the templates in dropped would get me to the behavior I was looking for). It may well be that the "on hold" category didn't even exist when I first started using dropped. I can't remember. But it seems like either "dropped" or "on hold" was added along the way. That may well have affected the decision to put the templates in dropped.

In any event, the goal should be to help people get to the result they are looking for, and I want to thank you again for your awesome contribution to that.

Best,

KS

kingsinger 2013-02-19 02:48 PM

A few more thoughts on the Templates script (nice work!)
 
Played around with this more. The new feature to place the project at the top of the folder is great. Indeed, the entire script is great. Nice improvement on Curt's script. Thanks again so much for making it.

Still a little bit confused about making the date stuff work. In particular the $date variables.

Maybe a few more concrete examples would help bring things into focus.

Have you considered doing a few screenshots of how you have a template set up with the dates, along with a couple more showing what the results look like after somebody actuates the script and walks through it (or maybe a quick screencast?)

pxldot 2013-02-24 06:59 AM

[QUOTE=kingsinger;120644]Played around with this more. The new feature to place the project at the top of the folder is great. Indeed, the entire script is great. Nice improvement on Curt's script. Thanks again so much for making it.

Still a little bit confused about making the date stuff work. In particular the $date variables.

Maybe a few more concrete examples would help bring things into focus.

Have you considered doing a few screenshots of how you have a template set up with the dates, along with a couple more showing what the results look like after somebody actuates the script and walks through it (or maybe a quick screencast?)[/QUOTE]
Funny you should mention that, Kingsinger. I'd been working on a big update (with some bugfixes that may have been affecting the due/ start date stuff) that included a new website with screenshots and a screencast. You can check everything out at [url]http://cmsauve.com/projects/templates/[/url]

kingsinger 2013-02-24 11:34 AM

This is awesome and very helpful! The additions you've made look great as well. That said, for some reason I'm not seeing the embedded screencast window in Firefox.

kingsinger 2013-02-24 05:52 PM

Got the screencast to work in Safari. Is there any way we might be able to get that cool icon for the script that you are using in the toolbar in the screencast?

You've added even more great features to this script too. Default folder is a great idea as is the chooser variable. Thanks so much!

kingsinger 2013-02-24 10:03 PM

Actually, never mind. I see that the icon is included with the script.

kingsinger 2013-03-11 12:51 PM

Another Quick Thought
 
Been using this for a few more weeks. It's great. Haven't really scratched the surface on the date logic stuff, but the parts I do really lower friction for me.

I did have one thought, though. Most of my templates are what I would call project templates. But I do have a couple that are actually more accurately referred to as task-chain templates (or I suppose sub-projects).

One example would be a template called review document. It contains a set of steps that I use when I review a document (e.g., a contract). So the chain might be:

Review $Name
Draft comments on $Name
Transmit comments on $Name to $PersonName
Receive feedback on $Name comments from $PersonName
Respond to $PersonName comments on $Name
Receive response comments from $PersonName on $Name
Finalize draft of $Name

When I actuate your script, it prompts me for the name of the document and the name of the person who I need to communicate with about the document.

Without your script, there are a lot of situations where I probably would not take the time to enter all these items, because the friction would be too great. But your script makes it very easy to do.

Nevertheless, in my current workflow, I need to create an instance of this template and send it to the folder I've chosen. Then, I need to manually drag it into the project where it will live.

I wonder if it would make sense to create class of template called task-chain or something like that. If that flag is in the project notes field of the template, then when the applescript is run, it would prompt the user and ask them which project they want to put the finished template into (or even more ideally where exactly in the order of the project it should be inserted).

It's a not a big thing, but I do think that at least for me, the less friction I have in entering these kinds of chains into OF, the more likely I am to do it. Otherwise, it's easy to just decide that it isn't worth the effort. And if stuff isn't in OF, then OF can't really help you keep track of it.

Especially on stuff where the review cycle may play out over a couple of days or weeks, having it in OF can be helpful, because then when you do a review and look at your Waiting For context, there will be an entry there showing that you're still waiting to hear back from somebody.

eronel 2013-10-26 02:07 PM

I've been using your wonderful and flexible script for templates and LOVE it. I'm able to automate so much more of my repetitive work this way.

And I'm also have trouble with setting due dates a year or more out. The script seems to add the time and then silently make a correction back one year. Examples:

[CODE]due: $today + 12 months[/CODE]
yields a due date of 10/29/13 when it should be 10/26/14.

[CODE]due: $today + 1 year[/CODE]
delivers a due date of today

However
[CODE]due: $today + 366 days[/CODE]
yields a correct due date of 10/27/14

I can work around the correction by using the last option, but this behavior is not what I expected based on the script instructions that say:
[QUOTE]When prompted for input, you can use any of the relative or absolute date strings you can normally use with OmniFocus[/QUOTE]

None of what I have pointed out above negates the value of this amazing tool. Thank you for the work you put in to create this very useful tool so that I as a non scripter could have this added functionality.

Lenore

RussBlaisdell 2013-11-29 05:58 AM

Is there a way to expand a list of tasks with a list ?
 
First off this is a great script and has really provided a lot of value. So thanks.
I often need to undertake a set of actions with a variable list of individuals. This can be to send e-mail to each individual, look for responses, set up meetings etc/all. I was wondering if there was a possibility that you could have an option for some variables that would cause any task with that variable to be duplicated as part of a list expansion ?
Basically if I had a task set such as :
Send email to <list> on $Subject
Wait for response from <list> on $Subject
Combine results from all parties

And when I run the template, I input
List = Tom, Jerry
Subject = Mouse Food

I get:
Send email to Tom on Mouse Food
Send email to Jerry on Mouse Food
Wait for response from Tom on Mouse Food
Wait for response from Jerry on Mouse Food
Combine results from all parties

I was looking at this script and I have no idea how to insert/duplicate a task in place (actually the number of things I do not know about applescript is huge :).


Thank you,
Russ

Pfitz 2014-04-01 06:55 AM

Love the idea of having a flexible templates system very much - but at the moment I am struggling at a very basic thing: how can I enter a variable at the context field? When I enter it OF automatically deletes it since there is no context with the variable name. Any one has a tip since it it obviously somehow possible to do it.


All times are GMT -8. The time now is 09:06 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.