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