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

 
Recursing nested contexts in AppleScript Thread Tools Search this Thread Display Modes
Hi

I'm trying to recurse down my contexts thus

tell application "OmniFocus"
my onContexts(contexts of default document)
end tell

on onContexts(contextList)
repeat with aContext in contextList
my onContext(aContext)
end repeat
end onContexts

on onContext(aContext)
set contextName to name of aContext
set contextLocation to location of aContext
my onContexts(contexts of aContext)
end onContext


the contextLocation line fails with
get |location| of context id "djPQ_ENEbMN" of document id "mN0RuP1Pwwj"
"OmniFocus got an error: Can’t make |location| of context id \"djPQ_ENEbMN\" of document id \"mN0RuP1Pwwj\" into type specifier."

Can any AppleScript wizards shed any light? I have found examples of iterating over flat contexts, but not my nicely organized hierarchical structure.

Thanks in anticipation

Duncan

Last edited by dmcg; 2009-01-06 at 02:25 PM..
 
Try this:

Code:
on onContext(aContext)
	using terms from application "OmniFocus"
		set contextName to name of aContext
		set contextLocation to location of aContext
		my onContexts(contexts of aContext)
	end using terms from
end onContext
The clue is that location wasn't showing up as a property but as a variable name. All objects have a name, so that line worked OK.
__________________
Cheers,

Curt
 
You're a star, does the business and I've learned a little more AppleScript, thanks.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying nested contexts vsuri OmniFocus 1 for Mac 5 2011-08-22 01:07 PM
Still no creating nested contexts with colon? braver OmniFocus for iPad 1 2010-08-01 08:44 AM
creating nested contexts braver OmniFocus for iPhone 1 2009-11-15 07:02 AM
Thank you for Nested Contexts! SpiralOcean OmniFocus 1 for Mac 2 2007-05-01 05:54 AM


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


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