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!

Does anyone know how to edit the below Scrip to enable focused projects in the sidebar to also be prioritizable?

Many thanks!
Josh

property pTitle : "Focus on flagged projects"

tell application "OmniFocus"
set oDoc to default document
set lstProjects to my ProjectList(oDoc)
if length of lstProjects > 0 then
set focus of front document window of oDoc to lstProjects
else
set focus of front document window of oDoc to {}
display dialog "No flagged projects found" with title pTitle
end if
end tell

on ProjectList(oParent)
using terms from application "OmniFocus"
tell oParent
-- ADJUST THE WHERE QUERIES TO MATCH
--THE TYPE OF PROJECTS YOU WANT TO LIST
set lstProjects to projects where (flagged is true) and ((status is active) or (status is on hold))
set lstFolders to folders where hidden is false
end tell
repeat with oFolder in lstFolders
set lstProjects to lstProjects & my ProjectList(oFolder)
end repeat
return lstProjects
end using terms from
end ProjectList

If you run the script which focuses on the flagged projects, you can go to the sidebar after the script runs, select all the flagged projects, copy them and paste them into a document (TextEdit and OmniOutliner are apps which will work). You can then reorder the rows of the document as you like to generate your prioritized list. The rows also serve as hyperlinks to OmniFocus, so when you want to work on the first project in the list, just click on it and you'll be transferred to OmniFocus, where a new window focusing on that project only will appear.

This approach is not limited to projects; anything you select in OmniFocus and copy/paste in this fashion should work. So, if you need a prioritized list of actions, you can do that as well, though you'll need to build up the list separately for actions and projects.