The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Making sub-contexts in AppleScript? (http://forums.omnigroup.com/showthread.php?t=11307)

nate 2009-02-12 01:16 AM

Making sub-contexts in AppleScript?
 
I can't seem to correctly make a subcontext, ie. "@Foo : bar". I can create @Foo, but when I try to create 'bar' as a subcontext of @Foo, it just creates it as a separate context (rather than a hierarchical one that you get if you drag and drop it).

I'm using code based on code by Curt Clifton, based on code by zooids, as follows:
set contextList to complete thePrimaryContext as context maximum matches 1
set contextID to context id (id of first item of contextList)
set newContext to make new context with properties {name:theSecondaryContext, container:contextID}

Despite saying "make this in the container contextID", it appears as a separate context. Any ideas?

thanks!
N

curt.clifton 2009-02-12 12:56 PM

Just guessing, but you might try an incantation like:

make new context at after first context of context contextID with properties {name:theSecondaryContext}

nate 2009-02-12 06:24 PM

Got an error:
906:1009: execution error: OmniFocus got an error: Can’t make context id "euSiwjFnDkn" of document id "b8S4l1DdM81" into type integer. (-1700)

What I've ended up doing is just creating all the contexts and then dragging them into the right hierarchy...!

thanks Curt! :-)
N

RobTrew 2009-02-12 09:17 PM

You could take a look at the "PlaceContextPath()" function in [URL="http://web.mac.com/robinfrancistrew/Site/iGTD2Omnifocus_files/iGTD2Omni_Ver41.applescript.zip"]iGTD2Omni_Ver41.applescript.zip[/URL]


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

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