PDA

View Full Version : Verify Next Actions Exist


curt.clifton
07-05-2007, 10:18 PM
I've posted a "Verify Next Actions Exist" script to my software downloads (http://www.rose-hulman.edu/~clifton/software.html#VerifyNA) page. This scripts scans all projects and action groups to identify those without an identified next action.

Share and enjoy!

SpiralOcean
07-08-2007, 11:43 AM
Dude! You are my hero!

Nice job on this.

One suggestion...
I added a line after line 131... in the accumulateMissingNAsTask handler

set end of accum to name -- CONSIDER: build better identifying string here
set note of theTask to note of theTask & "NoAction"

This will place a note in the project.

Now after this has run, I can go to the search field and enter
NoAction...
All my projects without actions show up!

It may be helpful to have a script that clears that out of the note, but right now I'm comfortable with doing it by hand.

Thanks for the code!

SpiralOcean
07-08-2007, 11:49 AM
my addition adds it to any tasks that had children that no longer have tasks... so a project can have children that at one point had tasks.

-MyParentProject
--myChildTask - tagged as no action
---myGrandTask -complete

May be a bug in the script... I'll look into it more

SpiralOcean
07-08-2007, 11:49 AM
I need to search for that note before it adds the note... otherwise... it will continue to append the note

SpiralOcean
07-08-2007, 11:56 AM
I need to search for that note before it adds the note... otherwise... it will continue to append the note

Here is the fix:
if note of theTask does not contain "NoActions" then
set note of theTask to note of theTask & "NoActions"
end if

SpiralOcean
07-08-2007, 11:57 AM
my addition adds it to any tasks that had children that no longer have tasks... so a project can have children that at one point had tasks.

-MyParentProject
--myChildTask - tagged as no action
---myGrandTask -complete

May be a bug in the script... I'll look into it more

Looks like the script is treating this as a project... which... maybe it is a project.

Sub-projects of a project.

SpiralOcean
07-08-2007, 12:44 PM
This is huge! Huge! It was a large missing portion of my workflow. I know Omni is working on this one, but what a relief to be able to see projects that need to be completed or a next action assigned!

You win hero of the week!

SpiralOcean
07-08-2007, 03:29 PM
There is a slight bug with this...

it will not detect projects that have never had an action associated with it.

curt.clifton
07-08-2007, 08:52 PM
Good catch. I'll tweak the recursion to check top-level projects without children. Also, great idea annotating the projects to allow searching for those missing a next action! I'll incorporate that into the updated script.

curt.clifton
07-08-2007, 09:22 PM
I've posted the updated script to my software downloads page (http://www.rose-hulman.edu/~clifton/software.html#VerifyNA). The script now catches top-level projects without any children. It also prefixes the name of offending projects with "Missing NA". The particular prefix is controlled by a property in the script. You can set the property to use the empty string if you want to disable this feature.

Share and enjoy!

SpiralOcean
07-09-2007, 09:46 PM
I got burned today...


I was merrily cranking my widgets... (actions)... when I had a strange thought of... why am I not working on Project A?

Turns out, the next action of project A did not have a context and was not showing up in my lists.

This is such an important thing for OmniFocus to Fix! It's insane that there isn't a way to see all unassigned contexts. Almost as insane as not being able to see all projects without next actions. ;)

The goal of GTD... is to do all the thinking first, so when I sit down to a list I am not thinking the following thoughts:
do I have the correct tools,
am I at the right place,
do I have enough time
is this the next action I need to work on for this project.

If the thinking is done, then when a person is processing actions in contexts, (or cranking widgets as David calls it) they are not thinking about whether they are seeing everything they should be seeing.

If they doubt that they may not be seeing everything in their current context, or if they doubt that they are not working on what is most important at the time, then they loose trust in the system and will put the software on a dusty shelf never to return to it again!


To solve this problem I modified your script. The recursion in it is quite impressive... I must say I learned a couple things by going through it.

But the script doesn't go over every task.

I added a small part beginning at line 127...

It scans all uncompleted tasks in the node, and if there is no context, it will add a note saying... "NoContext". This will allow me to perform a search on all NoContext items so I can assign a context.

If you add this to your current script, would you consider taking Growl out? I find it intrusive and don't want to leave it installed. If not, no worries, I'll install Growl so I can open the script to remove the Growl scripting. :o

One more thought... and let me preface by first bowing to your programming knowledge... that may sound sarcastic, but I assure you it is not.

The efficiency of this code is brilliant... but I wonder if it is accessing objects too much and you are loosing some speed from it?

One example...
set theSections to every section
is basically loading the entire outline into AppleScript.

If you reference the ID of the object, you won't load the entire object into AppleScript, but just a string, and can then access the OF object. It may speed things up a bit.

One way I have done this in the past is...
set taskListIDs to id of tasks of selectedTask
set taskCount to count (taskListIDs)

--Go through all tasks
repeat with iTask from 1 to taskCount
--get current task & attributes
set currentTask to task id (item iTask of taskListIDs) of (document documentID)
complete currentTask
end repeat


It may be more work than it's worth... especially if OF is going to fix these things. I've attempted to modify your recursion using ID's... and well... you use some incredibly efficient recursion! :)

Again... thank you for the script. It is extremely helpful!

SpiralOcean
07-09-2007, 09:58 PM
I just realized... if there is already a note in the action, there needs to be a return feed added before the tag. Otherwise, the tag runs into the current note.

You may have done this already in the newest version.

jasong
07-09-2007, 11:09 PM
Hi Curt,

Nie job on the script. I'm find it useful. Alas I'm not very good about adding NAs to my projects, and as a result, I find a large number of projects getting reported, so many that the dialog box grows to beyond the size of the screen! This cuts of the OK button. Fortunately it's set as the default, so hitting Return was fine, but perhaps you can limit to displaying status (e.g. "25 Projects found with no Next Actions")?

I'm on a 13" MacBook, btw.

SpiralOcean
07-10-2007, 06:20 AM
Hi Curt,

Nie job on the script. I'm find it useful. Alas I'm not very good about adding NAs to my projects, and as a result, I find a large number of projects getting reported, so many that the dialog box grows to beyond the size of the screen! This cuts of the OK button. Fortunately it's set as the default, so hitting Return was fine, but perhaps you can limit to displaying status (e.g. "25 Projects found with no Next Actions")?

I'm on a 13" MacBook, btw.

Have you attempted searching for "Missing NA" after the script has run?

jasong
07-10-2007, 12:15 PM
Have you attempted searching for "Missing NA" after the script has run?

I'm not sure how that helps me, unfortunately.

The problem is that the AppleScript dialog box that displays which items are missing NAs is so long that the OK button is off-screen and can't be clicked.

SpiralOcean
07-10-2007, 05:08 PM
Here is why I thought it helped you.

The reason you want to see all your projects in the dialog window is either:
1. You want to write them down so you can look them up after you hit the Drat button on the dialog box.
2. You want to see the projects so you can memorize them to look them up after you hit the Drat button.

If you use the search field in the top right corner of OmniFocus, and search for Missing NA, you will get all the projects that were found to have a missing next actions. (make sure the projects folder is highlighted before you perform your search)

Thus negating the need to see all of them in the Dialog box.

Let me know if this addressed your question.

Thank you.

SpiralOcean
07-10-2007, 05:17 PM
I'm not sure how that helps me, unfortunately.

The problem is that the AppleScript dialog box that displays which items are missing NAs is so long that the OK button is off-screen and can't be clicked.

I think I just understood your problem... good thing the button is the default. :rolleyes:

curt.clifton
07-10-2007, 07:23 PM
If you add this to your current script, would you consider taking Growl out? I find it intrusive and don't want to leave it installed. If not, no worries, I'll install Growl so I can open the script to remove the Growl scripting. :o


I happen to like Growl and so am unlikely to remove it. I might consider adding code that detects whether Growl is installed instead of always using it. Note that you can use the Growl System Preference Pane to disable Growl notifications.

One more thought... and let me preface by first bowing to your programming knowledge... that may sound sarcastic, but I assure you it is not.

The efficiency of this code is brilliant... but I wonder if it is accessing objects too much and you are loosing some speed from it?

One example...
set theSections to every section
is basically loading the entire outline into AppleScript.


Thanks for your kind words.

As I understand Applescript, the example you give does not load the entire outline. It loads references to every section, which are effectively like IDs. The advantage of doing it this way is that you don't have to ask the program to turn the ID back into an object.


One way I have done this in the past is...
set taskListIDs to id of tasks of selectedTask
set taskCount to count (taskListIDs)

--Go through all tasks
repeat with iTask from 1 to taskCount
--get current task & attributes
set currentTask to task id (item iTask of taskListIDs) of (document documentID)
complete currentTask
end repeat


You may be thinking of a common Applescript problem where people write things like:


repeat with aTask in every selected task
-- do something with aTask
end


This is horribly inefficient because the script asks the program for every selected task every time through the loop. The standard solution is something like:


set theTasks to a reference to every selected task
repeat with aTask in theTasks
-- do something with aTask
end


I might play with my code a bit to see if throwing in the "a reference to" incantation does change the performance. [Edit: Using the "reference to" syntax results in an error when trying to dereference list items.]

curt.clifton
07-10-2007, 07:30 PM
Hi Curt,

Nie job on the script. I'm find it useful. Alas I'm not very good about adding NAs to my projects, and as a result, I find a large number of projects getting reported, so many that the dialog box grows to beyond the size of the screen! This cuts of the OK button. Fortunately it's set as the default, so hitting Return was fine, but perhaps you can limit to displaying status (e.g. "25 Projects found with no Next Actions")?

I'm on a 13" MacBook, btw.

jasong,

Good idea! I've made the change and will post an update shortly.

SpiralOcean
07-10-2007, 08:45 PM
I happen to like Growl and so am unlikely to remove it. I might consider adding code that detects whether Growl is installed instead of always using it. Note that you can use the Growl System Preference Pane to disable Growl notifications.


It's your world boss... :-)

The frustrating thing about using the applescript to reference the growl dictionary is... it forces a person to install growl to use your applescript. At least, I haven't found a way to load the applescript without running the applescript without having Growl installed so I can delete the code.

For those not versed in Applescript, or using scripts, they may give up when they get the dialog box asking for the Growl dictionary.

Like I said... it's your code... your world.

curt.clifton
07-10-2007, 09:30 PM
It's your world boss... :-)

The frustrating thing about using the applescript to reference the growl dictionary is... it forces a person to install growl to use your applescript. At least, I haven't found a way to load the applescript without running the applescript without having Growl installed so I can delete the code.

For those not versed in Applescript, or using scripts, they may give up when they get the dialog box asking for the Growl dictionary.

Like I said... it's your code... your world.

I think there is a way to write the script so it doesn't use Growl if it isn't installed. You would still need to install Growl to edit the script. But for people wanting to muck about with the guts of the script, I don't think that's an unreasonable burden.

(Actually, if you don't have Growl installed, you can just pick any old app when prompted by Script Editor. You'll still have to delete the Growl references in order to save changes, but you don't really have to install Growl to edit the script.)

steve
11-18-2007, 03:38 PM
I'm using rev. 94791 and it seems to have stopped working. I get the following error message:

AppleScript reported the following error:
OmniFocus got an error: Some parameter is missing for activate.

I think this is an essential script. I hope Omni bakes in this functionality.
Is this script working for others?

update:
The script works, but I get the error message. Perhaps a minor part of the script isn't working for me-- i.e. growl integration.

curt.clifton
11-20-2007, 05:42 PM
The script works, but I get the error message. Perhaps a minor part of the script isn't working for me-- i.e. growl integration.

Steve,

Are you using version 0.4 of my script?

This error message is part of a very strange OF bug that we (Tim, Ken, and I) have been unable to track down. Ken and I both saw the bug, then it disappeared and we can't recreate it. There's another thread on the extras forum about it.

You could try deleting the "activate" line in the script, just below the [I]tell application "OmniFocus"]/I] line. That shouldn't cause any problems.

steve
11-21-2007, 01:20 PM
Yes, Curt. I am using .4. It seems to work, so I'm cool. Unfortunately, the clear next actions doesn't work at all. Do you still use this script in your reviews? I think it is a pretty key concept.

curt.clifton
11-21-2007, 08:25 PM
Steve,

The Clear Script only clears from selected items in the content pane. Is that how you are using it?

I use the Verify script on a daily basis. I haven't add a Missing NA since posting the Clear script, so haven't tested it since then.

steve
11-21-2007, 10:03 PM
Hey Curt,

I get this message when I invoke the clear script:

AppleScript reported the following error:
OmniFocus got an error: Can’t set name of tree to "Fundraiser Policy".

I'm amazed that you don't have many Missing NAs. I just counted and I had 32. I probably need to do a better job with daily and weekly reviews.

Steve

curt.clifton
11-22-2007, 04:33 AM
I get this message when I invoke the clear script...

Steve, is that a project or an action group? Did you select it in the sidebar or in the main content pane? (If I can duplicate the problem, I'll probably be able to fix it.)


I'm amazed that you don't have many Missing NAs. I just counted and I had 32. I probably need to do a better job with daily and weekly reviews.

I have a Show Missing NAs perspective that I use if any Missing NAs show up in my daily review (Planning mode, no focus, active projects, grouped by folder, show remaining actions, "Missing NA" entered in outline search field).

Often my items with Missing NAs are complete, so I just check them off. Otherwise I give them a next action. This is crucial to closing my open loops. If I am not prepared to give them a next action, then the project should probably be put on hold. A default next action might be "Brainstorm for 10 minutes about potential next actions to move project X towards successful completion."

steve
11-22-2007, 05:11 AM
is that a project or an action group? Did you select it in the sidebar or in the main content pane? (If I can duplicate the problem, I'll probably be able to fix it.)

Project selected in main content area. I've tried all the variations, (1 selected, all selected, none selected) but nothing seems to work. Don't spend too much time on this— I need to do my reviews and simply have less open loops. Gosh I hope this gets built in.

Thanks, Curt!

curt.clifton
11-22-2007, 07:18 AM
I can't duplicate that problem, but did uncover one that seems to have crept in with recent changes to OF. Try this version to see if it is any better: 386

steve
11-22-2007, 10:21 AM
Hey Curt,

Thanks for trying. I still get this message: The script 'Clear “Missing NA” Prefixes' could not complete.

I'm OK. . . I'll clear them by hand and learn to avoid projects w/o next actions!

curt.clifton
11-22-2007, 10:53 AM
Weird. Two more questions, if you're still interested...

- Do you have multiple OF windows open? (I typically run with just one window, and the window selection support recently changed in OF Applescript.)

- Are you on Leopard? (I'm still on Tiger until winter break.)

steve
11-22-2007, 09:20 PM
Of course I'm interested, but I feel like I need to start paying your or earning my own keep in this community.

- I've tested in one and multiple windows.
- Yes, I'm on leopard. That must be the problem.

Do you think something like this should be built in or do you think that only a few of us would use this?

I'm thinking about using the reveal script before I click anything as finished to avoid a Missing NA, but that is kind of a bummer.

curt.clifton
11-23-2007, 05:19 AM
Of course I'm interested, but I feel like I need to start paying your or earning my own keep in this community.

- I've tested in one and multiple windows.
- Yes, I'm on leopard. That must be the problem.

Do you think something like this should be built in or do you think that only a few of us would use this?

I'm thinking about using the reveal script before I click anything as finished to avoid a Missing NA, but that is kind of a bummer.

I'll upgrade to Leopard over Christmas break, so I'll deal with the problem with the Clear script then. As far as I know, the Verify script works fine on Leopard.

I definitely think identification of items that are missing next actions should be built in, but I'm also cognizant of the proliferation of highlighting in OF. So perhaps this should be a filter rather than a highlighting style.

jbursztyn
11-26-2007, 08:09 AM
hi,

Curt do I have to be in a specific view or folder to make this work. The next action script works beautifully bur the removal script does nothing. Any clues as to what I may be doing Wrong?

thanks

curt.clifton
11-26-2007, 11:21 AM
Curt do I have to be in a specific view or folder to make this work. The next action script works beautifully bur the removal script does nothing. Any clues as to what I may be doing Wrong?

You have to select in the content pane the item from which you want to remove the prefix. (It still may not work. Steve reported problems on Leopard and there is a problem with multiple open windows. I'm waiting on Christmas break for Leopard installation and a fix from Omni for the multiple window issue.)