View Single Post
Today I had some problems with a small script using the 'parse tasks with transport text' AS command. After some investigation I was able to reproduce the reason for my confusion:

Create a folder
Create a project below this folder named 'Test 1'
Create a second project below this folder named 'Test'

Run the following AS snippet:

tell application "OmniFocus"
set theTaskText to "--Testtask >Test @Home"
tell default document
set theResult to parse tasks with transport text (theTaskText as rich text)
end tell
end tell

I would expect that the new task is created in 'Test', because that's the name I provided, but to my surprise it ends in 'Test 1'. If you change the order of 'Test' and 'Test 1', the task will be created in the right 'Test' project.

It looks like OF searches for the first project where parts of the name are equal to the given project name, no matter if there is a project with *exactly* the same name as the search pattern. Is this expected behavior?
Is there a way to ensure that my task will be created in the correct place?

A short test shows the same behaviour for the predefined mail rule in OF…