View Single Post
I filed a feedback this morning. here's the text - any comments or workarounds?

Hello, I've encountered a problem (perhaps an MVC problem) when manipulating the notes of a project using applescript.

How to reproduce the problem:

  • open OmniFocus so that the project you're going to modify is visible in the content pane. Select a project that doesn't contain anything in the note (there is a problem regardless, but I want to demonstrate the behavior of the Note indicator)
  • close the note in the project so the notes for the project are not visible
  • run a script like this:

-- obtain the project somehow, here called playProject
tell playProject to tell note to insert "let's add something new here" & return at before first character
  • run the script again, so we'll expect "let's add something..." to appear twice at the top of the notes.
  • Observe the Note indicator at the right of the content pane. It does not show that there are any notes.
  • Open the notes of the project. This first time only, you will see "let's add something..." at the top of the notes.
  • (optionally) Close the notes of the project. Run the script two or three more times.
  • open the notes again. We only see the first two added rows. Apparently the first time you open the notes, you'll see the new data, but that time only. The project's Notes indicator still shows that the notes are empty.
  • if you use AppleScript to inspect the note (i.e. using display dialog), you'll see that the update is occurring correctly on the model, but the view is not updating it as expected.

If you click on another folder so the project is no longer visible in the content pane, and then return, the entire view, including the Note indicator on the project, display correctly and as expected.

More comments:

  • When doing this to a task instead of a project, everything works fine.
  • The problem presents the same whether modifying the note of the project directly, or by first obtaining the root task of the project and modifying its note (I'm guessing that the project merely delegates the call to the root task)