We're possibly going to use this in our fledgling web-thing, and others (dansays, QS, etc.) might find this useful...
As of earlier today there is a 'complete' script command in OmniFocus. This uses exactly the same logic as in the completion cells but presents it in a script-y interface.
Say you have two contexts, "abc" and "car", you can now do:
and get:
That is, you get a score-sorted array of match records, each with:
As of earlier today there is a 'complete' script command in OmniFocus. This uses exactly the same logic as in the completion cells but presents it in a script-y interface.
Say you have two contexts, "abc" and "car", you can now do:
Code:
tell application "OmniFocus" tell default document complete "a" as context end tell end tell
Code:
{{xml:"<span class=\"match\">a</span>bc", score:15, id:"bxMoRcqDm0g", name:"abc"}, {xml:"c<span class=\"match\">a</span>r", score:0, id:"krLrtHo7Pbe", name:"car"}}
- id: the identifier of the matching object
- name: the name of the matching object (currently the full hierarchical name, but we could add both this and the local name)
- score: the numerical score of the match; bigger is better. The result is already sorted, but this might be useful. It isn't scaled to any max value, so a relevance indicator would be hard to do.
- xml: a little XML blob of the 'name' marked up with <span> tags. The default span class name is "match". You can pass an optional 'span class' argument to the command to change this to whatever you want.
Last edited by Tim Wood; 2007-06-21 at 09:28 PM..