Page 1 of 1

Changing or deleting the found text rectangle

Posted: Sat Nov 29, 2008 5:46 pm
by Lynn P.
Hi all ~
In my constant quest for simplicity..
There are times I would prefer that text which is found in an app by the find command in a script is either not pointed out by the "found rectangle" put around the text, as it is not a search for the user to directly see the search result pointed out... and at other times I wish to have the text pointed out a different way such as changing the text color, highlight or style properties.

My question is...
Is there a quick or more elegant way to remove the rectangle than what I've come up with.
I usually do something like:

Code: Select all

  set the lockScreen to true --to hide the insertion cursor blinking
  find whole "lookForThis" in fld "FieldToSearch"
  set the textColor of the foundText to red -- do the preferred highlighting
  select after text of fld "FieldToSearch" -- get rid of the rectangle
  select after text of fld "HiddenField" 
--moves insertion cursor out of the "FieldToSearch" text field

Thanks for any input. Maybe I'm just missing something in the docs and my online search, and there is a really easy way to do this.
Lynn P.
Rev 2.8.1 / Mac OS 10.4.11

Posted: Sat Nov 29, 2008 7:37 pm
by Klaus
Hi Lynn,

Code: Select all

...
## Colorize the found text
set the textColor of the FOUNDCHUNK to red 

## Remove FIND rectangel 
select empty
...
might do the job :-)


Best

Klaus

Posted: Sat Nov 29, 2008 9:33 pm
by Lynn P.
Thanks Klaus ~
I must have some text field property set incorrectly or my copy of Rev is having fits about "Select empty" because after reading the docs, select empty should work in getting rid of the rectangle, but in my case.. it has decided it didn't want to be ignored. <g>
I thought something may have become corrupted, so I did a simple new stack with a regular text field (not a label), put some text in and added your code to a button, and it turned the "foundChunk" red as it should but the "select empty" did nothing.
I have no doubt "select empty" works however as I've been having wacko moments with my copy of Rev lately. I may reinstall a pristine version and try again. Obviously, "select empty" is exactly what I need. I just have to convince my copy of Rev. LOL!

Thanks for the help Klaus!

Posted: Sat Nov 29, 2008 9:41 pm
by bangkok
What about

Code: Select all

find empty
For me, the

Code: Select all

select empty
doesn't work.

Posted: Sat Nov 29, 2008 10:45 pm
by Lynn P.
bangkok wrote:What about
find empty
For me, the select empty doesn't work.
Thanks bangkok!
That works great. I tried the 'select empty' on an old 2.6 version of Rev and on another machine with a pristine copy of Rev 2.8 to no avail, although it still irks me because it should work. But 'find empty' works great as it cleans up the messy code I had.

I appreciate your time and the help from both of you. :)

Posted: Sun Nov 30, 2008 12:17 pm
by Klaus
YES! Slaponforehead :-)

"find empty" is correct, since the text was not SELECted but found, so this is definitively logical.

Have a nice day!


Best

Klaus

Posted: Sun Nov 30, 2008 4:44 pm
by Lynn P.
Klaus wrote:YES! Slaponforehead :-)
"find empty" is correct, since the text was not SELECted but found, so this is definitively logical.
Oh sure... throw logic in there! LOL!

Yep. That makes sense now. Thanks for pointing that out Klaus. If I understand the logic and reasoning behind something, my brain neurons tend to respect it more and keep the info around instead of letting it exit the other ear. <g>