View Single Post
Something seems to be amiss with the recording of selected objects/trees in focused project view sidebars.

In other words, there appears to be at least one bug (I am using OF 1.8 v77.61.0.137279) which affects selections in the project view sidebar if it is focused.

If you change a filter setting (manually or through script) when some objects are selected in the GUI, the selections of these objects will be preserved (as long as the objects remain visible) in the context view sidebar and content panel, and in the project view content panel. (Regardless, in each case, of focus settings)

They will also be preserved in the Project view sidebar panel if the focus is not narrowed (focus is {}).

If, however, there is a focus on a particular set of folders/projects, filter-changes will cause complete loss of selection (or mysterious transfer of selection to the library tree) in the project view sidebar, even when the selected folders/projects remain visible.

I suspect that this may be related to another bug, which is that the applescript select command (which works well when applied to visible folders, projects and tasks and contexts when focus is not narrowed) fails to behave correctly in the project view sidebar, if there is a focus in effect. When a focus is active, either the select command misfires, mysteriously selecting the library tree in lieu of the specified folder, or it raises an error, even when the specified folder is visible.

Code:
tell application "OmniFocus"
	tell front document
		set oWin to front document window
		
		set oSidebar to sidebar of oWin
		-- OF 1.8 only
		set lstFolders to flattened folders
		
		--set lstFolders to items 2 thru 4 of lstFolders
		
		-- Assumes a database with 3 or more folders
		set lstFolders to {item 3} of lstFolders
		
		-- IF WE SET FOCUS TO {}
		-- SELECT WILL WORK AS ADVERTISED
		-- BUT IT MALFUNCTIONS IF A FOCUS IS IN EFFECT
		set focus of oWin to lstFolders
		
		tell oSidebar
			repeat with oFolder in lstFolders
				-- This will mysteriously select the Library tree
				-- instead of the specified folder
				select {oFolder} with extending
			end repeat
		end tell
	end tell
end tell
(I have filed a report to help send feedback)

--

Last edited by RobTrew; 2010-08-15 at 12:24 AM..