The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Obj-C Access to Complete method (http://forums.omnigroup.com/showthread.php?t=23485)

cschneider 2012-02-14 09:47 AM

Obj-C Access to Complete method
 
I am working on a command line tool that interfaces with Omnifocus via obj-c's scripting bridge. I want to use the complete call to fuzzy-match contexts and project names.

Code: [url]http://github.com/cschneid/omnifocus-objc/blob/master/omnifocus/BridgeComponentFinder.m#L59[/url] (sorry for the unlinked url, had to create a new forum name for myself).

Problem 1: The complete call isn't generated as part of the Omnifocus.h that is built from osx tools (sdef /Applications/Omnifocus.app | sdp -fh --basename Omnifocus). This prevents me from using ScriptingBridge like I use for other calls.

Problem 2: I get around the first problem by building up an applescript string and sending that, but every single approach I use either doesn't compile correctly, or fails to coerce the string into a project object.

The compile errors are odd, since if I stop the debugger and print the string that I'm using as applescript, and then copy/paste it into AppleScript Editor, it runs find and returns the value I expect, with no problem.

I've gone through many iterations of the code here, and can't figure it out.


If you want to check out the code and run it, invoke it with "Run (cmd-option-r)" and set the command line options to [--task, "Test #aproject"] (2 args). Or run it from the command line as `omnifocus --task "Test #aproject"`

Also note that the rest of this tool does work currently for adding tasks. Check it out if interested - it's just a clone of OTask at the moment though.

Thank you to anybody who can help!


All times are GMT -8. The time now is 02:37 AM.

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