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 Today's Posts

 
New 'complete' AppleScript command Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
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:

Code:
tell application "OmniFocus"
	tell default document
		complete "a" as context
	end tell
end tell
and get:

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"}}
That is, you get a score-sorted array of match records, each with:
  • 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.
Hopefully you all will find this useful; let us know if there are other scripting hooks that'd be helpful too.

Last edited by Tim Wood; 2007-06-21 at 09:28 PM..
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
AppleScript move command bholveck OmniOutliner 3 for Mac 3 2012-01-19 02:55 PM
Bug in OmniFocus Applescript PBPASTE command RobTrew OmniFocus Extras 0 2011-04-14 11:41 AM
AppleScript references with no set or command MLModel OmniOutliner 3 for Mac 1 2010-11-21 11:34 AM
Applescript Duplicate command: how to use it? Lutin OmniFocus Extras 6 2007-10-30 12:56 AM
AppleScript 'do script' command Bcpst OmniWeb Feature Requests 2 2006-05-06 11:08 PM


All times are GMT -8. The time now is 08:16 PM.


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