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 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
How to add a project focus to a perspective Thread Tools Search this Thread Display Modes
Quote:
Originally Posted by magobaol View Post
Hi whpalmer4,
thank you for yor hint, but it doesn't work for me. When I click "Show all", just one project remains selected in the sidebar, even if I selected all the projects in my perspective. :-(
Well, actually... this works.
I've just tried again this procedure and this time the projects remain selected. But sometimes not all of them remain selected.
I will do some other test and in case I will report it as a bug.

Ciao,
Francesco
 
Quote:
Originally Posted by magobaol View Post
what I mean was to filter the projects in the left panel, not just the actions, and I seems there is no way to do this (using the flag status)
I tend to use a script for re-focusing the sidebar - on my system it seems to run marginally faster than retrieving a stored perspective.

for example, to list only flagged projects in the sidebar:

Code:
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
 
Quote:
Originally Posted by RobTrew View Post
I tend to use a script for re-focusing the sidebar - on my system it seems to run marginally faster than retrieving a stored perspective.

for example, to list only flagged projects in the sidebar:

Code:
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


Hi Rob,

Thanks very much for posting the "Focus on flagged projects" Script. I had been trying to fathom a workaround for this in OmniFocus until I found the script.

I was wondering; Is there a way of getting the script to also enable the prioritization of flagged projects in the sidebar? (without effecting the position of those projects within their Projects Folders)

After applying the Script, I tried prioritizing the focused Projects in the Sidebar and they just jumped to the top of the Sidebar (and out of their Project folders - in Library view).

This function would be a great help!
 
I don't think that there is any way of avoiding the fact that dragging focused projects to new relative positions will drag them out of their folders.

Might be worth a request to the Ninjas through Help > Send Feedback ...

In the meanwhile, I think you can probably make the script a bit simpler and faster by rewriting it along these lines:

Code:
property pTitle : "Focus on flagged projects"

tell application id "OFOC"
	tell default document
		set refProjects to a reference to (flattened projects where (flagged is true) and ((status is active) or (status is on hold)) and ((its folder is missing value) or ((effectively hidden of its folder) is false)))
		set {lstID, lstName} to {id, name} of refProjects
		set lstProjects to contents of refProjects
		set focus of front document window to lstProjects
		
		if length of lstProjects < 1 then
			display dialog "No flagged projects found" buttons "OK" default button "OK" with title pTitle
		else -- Place linked MarkDown text in Clipboard
			set strMK to ""
			repeat with i from 1 to length of lstID
				set strMK to strMK & "*" & tab & "[" & item i of lstName & "](omnifocus:///task/" & item i of lstID & ")" & return & return
			end repeat
			tell application id "MACS" to set the clipboard to strMK
		end if
	end tell
end tell

Last edited by RobTrew; 2012-05-04 at 08:17 AM.. Reason: Edited code to properly handle projects not in folder, and place linked Markdown text in clipboard
 
Edited the code in the previous post to:
  • Correct the handling of flagged projects which are not inside folders
  • Place a linked text list of the projects (Markdown format) in the clipboard.

(You could at least use this script paste a text list somewhere and reorder that. If you drop the text into a Markdown processor you will get clickable hyperlinks back to the projects in OF).
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Omni Focus Perspective Print to Dropbox Yury OmniFocus Extras 5 2013-04-28 08:58 AM
A Perspective Containing a Focus *AND* the Inbox [Feature Request - email support] gordonw OmniFocus 1 for Mac 16 2013-01-18 01:59 PM
Using boolean for project focus WebbChad Applying OmniFocus 2 2011-12-04 06:24 AM
Support for 'Focus' and 'Perspective' ? booya OmniFocus for iPhone 13 2010-07-15 12:02 PM
Thank you for Project Focus! SpiralOcean OmniFocus 1 for Mac 0 2007-04-30 07:54 PM


All times are GMT -8. The time now is 12:32 PM.


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