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?

thanks!
N
 
Just guessing, but you might try an incantation like:

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

Curt
 
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
 
You could take a look at the "PlaceContextPath()" function in iGTD2Omni_Ver41.applescript.zip
 
 


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 03:21 PM
Recursing nested contexts in AppleScript dmcg OmniFocus Extras 2 2009-01-06 11:45 PM
Making it All Work steve Applying OmniFocus 4 2009-01-01 08:55 PM
How To: When should I next travel to ... ? Making contexts happen Anita OmniFocus 1 for Mac 4 2008-01-02 08:28 PM
Smart Contexts via AppleScript kmarkley OmniFocus 1 for Mac 7 2007-12-08 06:24 AM


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


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