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

 
Unable to FIND text in columns that have the type property set to "pop-up list" Thread Tools Search this Thread Display Modes
Batch search is great. And I like OmniOutliner auto-hoists a clicked individual result (a listed section).

But neither Batch search nor Find will locate text in "pop-up" columns!

Search/Find work as expected if I set the column type to Rich Text. Please don't tell me that choosing the Rich Text column type is a necessary step.

Once again I find the "OmniOutliner-3.0-Manual.pdf" anemic—this time on the topics of Find, Search and Pop-up: I only see seven references to Pop-up list in the 3.0 User Guide, and none mention anything about pop-up columns being excluded from Search and Find.

Since my adoption of OmniOutliner I've always felt that its documentation is surprisingly sparse for such a great product. And sorry to say, the built-in in Help system is even less helpful and less navigable that the User Guide.

I'm using OOpro 3.10.

The Help menu does not provide a URL for the latest User Guide. (A reply in another thread hinted of a more recent User Guide. That would be wonderful, particularly if it covers topics more completely!)

Thanks!

qomni

Last edited by qomni; 2012-02-02 at 10:56 AM..
 
Quote:
Originally Posted by qomni View Post
neither Batch search nor Find will locate text in "pop-up" columns
That is, unfortunately, a limitation of the way in which search is implemented in oo3.

The key move, in such cases, is to send of a quick email through the Help > Send Feedback ... item in the OO3 menu.

In the meanwhile (and in the spirit of Rube Goldberg) a script which found strings regardless of column type might look something like this:

Code:
property pTitle : "Find string in any column"
property pVer : "0.5"

property pTerm : ""

-- ver 0.5 Double quotes specify an exact match. e.g.  "checked" vs checked  (the latter finds *all* rows if there is a checkbox column)

on handle_string(strTerm)
	set pTerm to strTerm
	
	MatchRows(pTerm)
end handle_string

on run
	tell (display dialog "Find:" default answer pTerm buttons {"Cancel", "OK"} default button "OK" cancel button "Cancel" with title pTitle & "  ver. " & pVer)
		set pTerm to text returned
	end tell
	
	MatchRows(pTerm)
end run

on MatchRows(strTerm)
	set blnExact to (strTerm begins with "\"") and (strTerm ends with "\"")
	if blnExact then set strTerm to text 2 thru -2 of strTerm
	
	tell application id "OOut"
		set oDoc to front document
		
		tell oDoc
			set lstSeln to {}
			if blnExact then
				repeat with oCol in columns
					set end of lstSeln to (rows where (value of (cell id (id of oCol))) = strTerm)
				end repeat
			else
				repeat with oCol in columns
					set end of lstSeln to (rows where (value of (cell id (id of oCol))) contains strTerm)
				end repeat
			end if
		end tell
		set lstSeln to my FlatList(lstSeln)
		
		if lstSeln ≠ {} then
			-- ENSURE THAT THE PATH TO THE MATCHING ROWS IS EXPANDED
			repeat with oSeln in lstSeln
				set expanded of (ancestors of oSeln) to true
			end repeat
			select lstSeln
		else
			display dialog pTerm & " not found in " & (name of oDoc) buttons {"OK"} default button "OK" with title pTitle & "  ver. " & pVer
		end if
		activate
	end tell
end MatchRows

on FlatList(lst)
	if class of lst is not list then
		{lst}
	else if lst ≠ {} then
		FlatList(item 1 of lst) & (FlatList(rest of lst))
	else
		{}
	end if
end FlatList

Last edited by RobTrew; 2012-02-02 at 09:51 PM.. Reason: Ver 5 - double quotes for exact field match e.g. "checked" or "unchecked" vs checked for values in checkbox columns
 
Thanks Rob!

The script you posted is helpful. It highlight/selects all rows with the search term.

Ideally I'll want to find, and then find next, so maybe I'll tinker with the script.

Much appreciated!

qomni

Quote:
Originally Posted by qomni View Post

... neither Batch search nor Find will locate text in "pop-up" columns!
Quote:
Originally Posted by RobTrew View Post

That is, unfortunately, a limitation of the way in which search is implemented in oo3.

In the meanwhile (and in the spirit of Rube Goldberg) a script which found strings regardless of column type might look something like this:

Code:
property pTitle : "Find string in any column"
property pVer : "0.2"

property pTerm : ""

tell (display dialog "Find:" default answer pTerm buttons {"Cancel", "OK"} default button "OK" cancel button "Cancel" with title pTitle & "  ver. " & pVer)
	set pTerm to text returned
end tell

tell application id "OOut"
	set oDoc to front document
	tell oDoc
		set lstSeln to {}
		repeat with oCol in columns
			set end of lstSeln to (rows where (value of (cell id (id of oCol))) contains pTerm)
		end repeat
	end tell
	set lstSeln to my FlatList(lstSeln)
	if lstSeln ≠ {} then
		select lstSeln
	else
		display dialog pTerm & " not found in " & (name of oDoc) buttons {"OK"} default button "OK" with title pTitle & "  ver. " & pVer
	end if
	activate
end tell

on FlatList(lst)
	if class of lst is not list then
		{lst}
	else if lst ≠ {} then
		FlatList(item 1 of lst) & (FlatList(rest of lst))
	else
		{}
	end if
end FlatList

Last edited by qomni; 2012-02-02 at 10:53 AM..
 
Thanks Rob. Once again, you've written a script that really extends OO for me. I've long been frustrated by the inability to filter a view by columnar data. While this script doesn't actually filter the view, by highlighting every item with the search string, it's a good 2nd best solution for me.

Up till today, I've been creating "Tags" in a separate column, and then using the Utility Drawer search function to search for them. The Tags column had to be a text column, not a drop-down list, as OO's search function wouldn't search for values in a drop-down list. This is major for me. Using a drop-down list is a real improvement for me, as it means I don't have to type the same Tags in each time (and don't have to make sure the spelling is exact) ... I just choose the desired Tag from the drop-down list and it gets entered properly.

Many, many thanks.
 
Okay, I've discovered a hitch - the script finds a search string only if the item is visible, that is, it's not a child item hidden from view beneath a collapsed parent. Is there any way that the script could be adapted to expand any parent items it needs to in order to reveal the child items which contain the search string?
 
Good idea :-)

Amended above to expand the path to matching rows.
 
Awesome. I cannot begin to explain how much this helps me.

Many thanks.
 
Good :-)

FWIW I've also added LaunchBar parameter handling.

(Choose the script with a LaunchBar abbreviation, tap the space-bar, and enter a search string).
 
Quote:
Originally Posted by rogbar View Post
I've long been frustrated by the inability to filter a view by columnar data.
I presume you've seen the other filtering scripts ?
 
I did - but since the filtering script doesn't show parent items, I prefer the highlighting script. By seeing the context the highlighted item is in, I know exactly what it is.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't sort a column when its type property is set to "pop-up list" qomni OmniOutliner 3 for Mac 8 2012-02-02 10:05 AM
"Find" in other columns? enderw88 OmniPlan General 1 2010-04-06 01:56 PM
Crashes when scripting "group rank" property in OmniGraffle timcoffman AppleScripting Omni Apps 1 2009-07-09 06:50 AM
Disable "find as you type"? kocab OmniWeb Feature Requests 8 2008-04-21 09:16 AM
"Find" to search through text boxes as well.. Jasko OmniWeb Feature Requests 2 2006-12-01 11:57 AM


All times are GMT -8. The time now is 06:01 AM.


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