Script: Focus on Current Selection
Some of this was cribbed from Curt Clifton's Populate Template Placeholders scripts. The basic idea is: let's say that you have a task selected in a 'Next Actions' list, or in Context mode, or whatever -- you can't see the entire project, and you would like to. This script will open a new window with focus set to the projects of whichever tasks (or projects) you currently have selected. Nothing more, but nothing less.
Hope it's useful Jeremy [CODE] tell application "OmniFocus" tell front document tell document window 1 -- (first document window whose index is 1) set theSelectedItems to selected trees of content if ((count of theSelectedItems) < 1) then -- try sidebar selection set theSelectedItems to selected trees of sidebar end if end tell if ((count of theSelectedItems) < 1) then display alert "You must first select a project or a task." message "Select a project or task to focus on." as warning return end if set theSelection to {} repeat with i from 1 to count of theSelectedItems set selectedItem to the value of item i of theSelectedItems if class of selectedItem is task then set selectedItem to containing project of selectedItem end if copy selectedItem to end of theSelection end repeat set newWin to make new document window with properties {selected view mode identifier:"project", focus:theSelection} end tell end tell [/CODE] |
Nice script, Jeremy. I'm glad you were able to use some of my code.
In OF you can double click the handle of an item in Context mode to focus on the item's project in a new window. Your script supports multiple items, which is a nice refinement. |
Ah, I didn't know about the handle click. Thanks for that! In any case, this works in Proejct mode, as well and supports multiple items. Thanks for checking it out!
|
The double-click on a handle works in project mode as well, but it won't do multiple projects, so your script is a useful tool. It's also faster than creating a new window and then focusing on a select group of projects -- something I try to avoid due to the inevitable pause.
|
All times are GMT -8. The time now is 12:16 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.