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 Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Making sub-contexts in AppleScript? Thread Tools Search this Thread Display Modes
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?

Just guessing, but you might try an incantation like:

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

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! :-)
You could take a look at the "PlaceContextPath()" function in

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Export from the command line or AppleScript for specific contexts/projects? xuinkrbin. OmniFocus Extras 1 2010-09-30 04:21 PM
Recursing nested contexts in AppleScript dmcg OmniFocus Extras 2 2009-01-07 12:45 AM
Making it All Work steve Applying OmniFocus 4 2009-01-01 09:55 PM
How To: When should I next travel to ... ? Making contexts happen Anita OmniFocus 1 for Mac 4 2008-01-02 09:28 PM
Smart Contexts via AppleScript kmarkley OmniFocus 1 for Mac 7 2007-12-08 07:24 AM

All times are GMT -8. The time now is 12:28 AM.

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