View Single Post
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