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 Today's Posts

 
All but on-hold Projects? Thread Tools Search this Thread Display Modes
Quote:
Originally Posted by RobTrew View Post
  1. I presume that you are now running OF 1.8 (sneaky peek) ?
  2. Have you copied and pasted the whole of the script straight into the Applescript Editor ?
no still on 1.7.5 of OF
Yes copy and paste whole script

Got a new error running the script you put in a file

"OmniFocus got an error: Can’t get every «class FCfx» of document 1 whose status ≠ on hold and («class FCHe» of folder = false or folder = missing value)."
 
Quote:
Originally Posted by Oogiem View Post
no still on 1.7.5 of OF
OK, that is the problem.

This script will only work with OF 1.8

You can get OF 1.8 from the link which Hypotyposis provided in the earlier posting in this thread.
 
Ah, thanks then. I'll wait. I have been too recently burned by testing new SW on my real system. I'll wait until it's out for real and been pushed by real users for a bit more than a few days.

No offense to Omni, but after my latest fiasco with Apple iOS4 and my iPod (and that was a "tested" system). I can't afford to mess up my existing workflow to try to fix what is a nagging but not deal breaker problem for me.
 
That's understandable. This modified version should work in 1.7 as well as in 1.8

It acts as a toggle, flipping back and forth, with each successive run/click, between either releasing the filter and focus, or focusing on just projects which are not on-hold.

Code:
-- Toggle between no focus and focus on filtered subset (in view with Grouping=Filter)

property pstrFilter : "where (status is not on hold) and ((effectively hidden of its folder is false) or (its folder is missing value))"
property pLibraryTree : 2

property pstrNewScript : "
script
on GetProjects(oDoc)
	using terms from application \"OmniFocus\"
		return flattened projects of oDoc " & pstrFilter & "
	end using terms from
end GetProjects
end script
"

property pstrOldScript : "
script
on GetProjects(oParent)
	using terms from application \"OmniFocus\"
		tell oParent
			-- ADJUST THE WHERE QUERIES TO MATCH THE PURPOSE
			set lstProjects to projects " & pstrFilter & "
			set lstFolders to folders
		end tell
		repeat with oFolder in lstFolders
			set lstProjects to lstProjects & my GetProjects(oFolder)
		end repeat
		return lstProjects
	end using terms from
end GetProjects
end script
"

tell application id "com.omnigroup.OmniFocus"
	set oDoc to default document
	set oWin to front document window of oDoc
	tell oWin
		if selected view mode identifier of oWin is not "project" then ¬
			set selected view mode identifier to "project"
	end tell
	if my IsNarrowed(focus of oWin) then
		set focus of oWin to {}
	else
		if build number ≥ "77.57.0.134152" then
			set oScript to run script pstrNewScript
		else
			set oScript to run script pstrOldScript
		end if
		set lstProjects to GetProjects(oDoc) of oScript
		tell oWin
			set focus to lstProjects
			set selected grouping identifier of content to "folder"
		end tell
	end if
	tell sidebar of oWin
		--set selected smart group identifier to "all-projects"
		select tree pLibraryTree
	end tell
end tell

-- Detect whether the sidebar has a narrowed focus
on IsNarrowed(oFocus)
	repeat with oObj in oFocus
		return true
	end repeat
	return false
end IsNarrowed

Last edited by RobTrew; 2011-07-05 at 07:46 AM..
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
Reviewing projects on hold NaviKhota OmniFocus for iPad 1 2012-05-14 06:26 AM
Available items & On hold projects physicistjedi OmniFocus for iPhone 15 2009-09-16 05:14 AM
'On Hold' for a folder of projects hagbard5235 OmniFocus for iPhone 0 2008-08-16 07:05 PM
On Hold Projects gerry OmniFocus for iPhone 4 2008-08-01 01:46 PM
Possible to have on-hold Actions (like Projects)? omnibob OmniFocus 1 for Mac 7 2007-12-27 03:23 PM


All times are GMT -8. The time now is 12:49 AM.


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