The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Automatically create a waiting for task? Thread Tools Search this Thread Display Modes
Much appreciated - very helpful for my workflow.
After using the script for a bit, I need to hack it just a bit to include the original Context in the task that's placed into the "Waiting" context.

If you haven't tried this nice little script, essentially what it does is copy the highlighted task(s), marks the original task(s) "Complete" (leaving it in the original context) and then putting the duplicated task into the "Waiting" context. It prepends the task in the Waiting context with text of your choice (I have mine set to "Awaiting:").

Due to the way that I use contexts, particularly for Agenda items, I need a bit more info in the copied task. I want to put a trailer on the task that shows the original context (remember, the copied task is now in the "Waiting" context).

With the current script, the task in the Waiting context looks like this:
Awaiting: bla bla bla

I would like it to look like:
Awaiting: bla bla bla From:originalContext (e.g. Agenda)

Alternatively it could simply be:
Awaiting from originalContext - bla bla bla

Either way, the trick is to capture the original context. I tried the following (only a portion of the original script) but I get an error.

set itemTitle to name of anItem
set oldContext to context of anItem
set theDupe to duplicate anItem to after anItem
set completed of anItem to true

-- Configure the duplicate item
set oldName to name of theDupe
set name of theDupe to waitingPrefix & oldName & " From: " & oldContext
set context of theDupe to theWaitingForContext
set repetition of theDupe to missing value

Any suggestions?


Last edited by rebunkerjr; 2009-04-11 at 05:35 AM..
Got it! One of these days I should learn AppleScript ;)

Here is the final snippet (changes in blue):
set itemTitle to name of anItem
set oldContext to name of context in anItem & ": "
set theDupe to duplicate anItem to after anItem
set completed of anItem to true

-- Configure the duplicate item
set oldName to name of theDupe
set name of theDupe to waitingPrefix & oldContext & oldName

set context of theDupe to theWaitingForContext
set repetition of theDupe to missing value

Note: I also changed the prefix as follows:
property waitingPrefix : "@"

As a result, the new task in the Waiting context looks like this:
@Phone: Call Tony to discuss bla bla bla
Curt - Thanks very much I have just downloaded it but not used it yet however I wanted to say thanks before I forgot. Its a nice solution and the growl feature is a stylish touch. BTW I love your where to focus script to.
Thanks Curt, the script works flawlessly on my system and will save my fingers in the future. Should have discovered it sooner.

Curt - this seems to be exactly what I have been looking for. I have previously used the Outlook Add-in for GTD, which had different buttons for waiting for, delegate, ect. However, after having moved to Mac I find that I am missing the simplicity of this Add-in. I have tride to download your script, but as I am a newbie in the script world. I don't seem to be able to figure out how this works. How do I tell OF when to use this script? I do not find a button to "push" and cannot find this in any drop down list. Sorry about being so stupid - hope you can "spoon feed" a little. Thanks! Kari Anne in Oslo, Norway.
Kari Anne,

First you need to create a directory to hold any OmniFocus scripts:
  1. Open a Finder window and click on Library (under PLACES in the side bar)
  2. Go to the Scripts folder
  3. Under Scripts, go to Applications. If this folder doesn't exist, then create a new folder and give it that name. If you're using a Norwegian localization, these names might be different. I'm not sure.
  4. Having found or created Applications, create a folder inside it called OmniFocus.
  5. Copy the script file to the new OmniFocus folder.

Now if you quit OmniFocus and restart it, OF will notice that there are some scripts. If you right-click on the tool bar in OF, you can choose to customize it. Scroll down through the various buttons and you'll find the scripts. You can drag the Complete and Await Reply button onto the toolbar.

Hope that helps!


Great script! I have been using it from my toolbar, and have a keyboard shortcut I created in Keyboard Maestro. It is quite useful for emails and phone calls, where it acts as a reminder that can be completed if the person responds, or I can follow up if I don't hear back.

I made the modifications that Rebunker suggested, and customized it to my liking.

But I do have a request, which I have been unable to solve with several hours of tinkering with AppleScript (I am a newbie to AppleScript):

Is there a way of creating a dialog box that would allow one to set new dates for follow-up? In other words, how could I invoke the script, have it ask me for the days/weeks/months to delay, and then create the new task in the Waiting For context, with new dates (so that it doesn't show up until I want it to)?

Could I create a new property:

property defaultFollowUp : 3 ?

Then, could I create a dialog box such as this:

display dialog "Follow up in how many days?" default answer defaultFollowUp buttons {"Cancel", "OK"} default button 2 ?

And then how would I get the script to modify the start date and due date within OF?

I tried for quite some time reviewing this script, and the excellent 'Defer' script by Dan Byler, which has a dialog box that allows such modifications, but was not able to get the script to complete.

Again, I am quite the noob with AppleScript, so i appreciate any input folks might have.

I fiddled quite a bit more with both scripts, and believe I am almost there. The enclosed AppleScript borrows from Curt ('Complete and Await Reply'), Dan Byler ('Defer' script), and Rebunker (modifications in this thread, just above).

The only problems I have are:

1. It is probably much longer than it needs to be;
2. For multiple items, it asks for the days of follow up, and whether you want to alter the start date, due date or both, sequentially for each of the items you selected.
3. If I hit 'Cancel', the script completes anyway, and I get the message, "AppleScript reported the following error: OmniFocus got an error: User canceled."

For number 1, if an AppleScript maven can tidy it up, bravo!

For number 2, if an AppleScript maven can pull out the name of each item, and include this in the dialog, double bravo!

For number 3, can anyone point me in the right direction? Hopefully this is an easy one for someone who knows more than I about AppleScript. I would like to get rid of this message.

In short, I have this set up so that when I leave a task in someone else's hands, I can automatically place the task in the 'Waiting For' context, place the previous context in the title, defer the task for a fixed number of days, and then have it pop back into my consciousness at that time.

Let me know if you all have any questions or ideas!

Attached Files
File Type: zip Pending Follow (92.8 KB, 167 views)

Last edited by sawxray; 2010-03-28 at 06:55 PM..
This post is extremely late to the party so forgive that aspect.

With my workflow, I have actually assigned a search perspective, searching for the word !Email because I want to keep my context specific to the issue at hand rather than having it all over many contexts.

With this script, I want to be able to create a new "Waiting for" task once I complete the "Email" task, but to be in the same context it is in now. So if a task is in Customer A context, I want the waiting for to remain in that context.

Is that possible with this script?


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically create a Table of Contents kparkes OmniGraffle General 1 2013-10-14 02:27 AM
Script for getting rid of task notes automatically? FMiguélez OmniFocus Extras 6 2011-07-26 08:57 AM
The old 'automatically create a Sitemap' problem Angostura OmniGraffle General 1 2010-01-29 10:27 AM
AppleScript help: Create sub-task, project from task iNik OmniFocus Extras 3 2007-12-05 08:53 AM
Shouldn't task get automatically moved to projects? tango OmniFocus 1 for Mac 8 2007-07-29 03:05 AM

All times are GMT -8. The time now is 03:23 PM.

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