The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   What is the point of "flattened" things? (http://forums.omnigroup.com/showthread.php?t=30133)

enderw88 2013-06-24 08:23 PM

What is the point of "flattened" things?
 
Why are there flattened tasks, project, contexts, etc? Several seemingly simple query work with flattened item and I don't understand why they wouldn't work with the not flattened items.

RobTrew 2013-06-25 12:33 AM

The non-flattened versions are nested tree-like structures, and you would have to write a recursive function to 'walk' through them in order to visit every context, or every project in every folder, rather than just the top-level nodes which are immediate children of the document.

The 'flattened' versions are full lists of every node in the tree.

enderw88 2013-06-25 01:20 PM

[QUOTE=RobTrew;125627]The non-flattened versions are nested tree-like structures, and you would have to write a recursive function to 'walk' through them in order to visit every context, or every project in every folder, rather than just the top-level nodes which are immediate children of the document.

The 'flattened' versions are full lists of every node in the tree.[/QUOTE]

Fair enough, but why doesn't something simple like:

[CODE]set theProject to project named "fooglebar"[/CODE]

work, when

[CODE]set theProject to flattened project named "fooglebar"[/CODE]

does?

or is the actual name of the project the full path?

RobTrew 2013-06-25 01:32 PM

This will work:
[CODE]tell application id "OFOC"
tell default document
set oProj to project named "top level project"
end tell
end tell[/CODE]

but only if that project is an immediate child of the document. i.e. if it is a top level project, not contained in a folder.

To find a project in a folder you would have to "tell" that folder to

[CODE]set oProj to project named "contained in folder"[/CODE]

In other words unflattened objects are only found by name within the scope of their containing object (e.g. containing folder for projects, parent context for contexts, containing group or project for tasks).

enderw88 2013-06-25 02:04 PM

[QUOTE=RobTrew;125685]This will work:

In other words unflattened objects are only found by name within the scope of their containing object (e.g. containing folder for projects, parent context for contexts, containing group or project for tasks).[/QUOTE]

Thanks you, that completely explains it.


All times are GMT -8. The time now is 07:57 AM.

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