View Single Post
Quote:
Originally Posted by Tim Wood
Hopefully you all will find this useful; let us know if there are other scripting hooks that'd be helpful too.
I've submitted a few requests for scripting hooks via Send Feedback. Here they are in case others want to second the requests:
  • Expanded status of notes
  • Expel ancestors and expel descendants (as in OmniOutliner)
  • There doesn't seem to be a way to get a list of all projects and folders in order via AppleScript. The dictionary lets you get either the folders or projects, but simply concatenating these lists loses ordering information, e.g., the fact that a top-level project might be between two top-level folders.

    Here's a script that comes close to what I want, but suffers the ordering problem:

    Code:
    tell front document of application "OmniFocus"
    	activate
    	set topLevelFolders to every folder
    	set topLevelProjects to every project
    	set topLevelProjectsAndFolders to topLevelFolders & topLevelProjects
    end tell
    I think this really gets back to a fundamental issue: the folders, projects, and actions are distinct objects. This makes recursion over the Projects tree more difficult than it need be. It seems like there should be a "tree item" class allowing access to all the properties (like name, note, id, perhaps next action and available actions, …) that are in common. It also seems like there should be a way to access the top-level projects tree. Something like:
    Code:
    tell front document of application "OmniFocus"
    	activate
    	set topLevelProjectsAndFolders to descendant trees of projects tree
    end tell
  • Script based access to meta-data fields. I'm thinking of something like the conduit settings in OmniOutliner.