View Single Post
Quote:
Originally Posted by Owen Linzmayer View Post
Thanks. That's a step in the right direction, but there's no way to save filters for future use, and it appears I would have to step through the process for every worker resource because there's no batch capability.
My first thought was to create an AppleScript to do this. Under "Task" there is a "filtered" property, which (according to the dictionary) can be turned on and off (it is not marked "r/o").

However, a simple script (below) which just sets that value to "true" gets an error:

Quote:
OmniPlan got an error: [<OPTask 0x17795c60> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key isFilteredOut.
So, this hit a dead end.

FWIW this is the script:

Code:
tell application "OmniPlan"
	-- Note:  Inspector has "" as its name, and is often the front!
	set frontWindow to front window where name is not ""
	set selTasks to selected tasks of frontWindow
	set namelist to ""
	repeat with curtask in selTasks
		if namelist is not "" then set namelist to namelist & "; "
		set namelist to namelist & (name of curtask)
	end repeat
	display dialog "Filtering view to remove tasks:  " & namelist
	repeat with curtask in selTasks
		set filtered of curtask to true
	end repeat
end tell