Use "find" on an active/focused window

Ben Rubinstein benr_mc at
Fri Mar 22 04:44:00 EST 2002

on 21/3/02 9:32 PM, Steve L at prodevm at wrote:

> Let's say I was on the internet and had a page/window
> open, and I wanted to open a Run-Rev made program and
> have it use the "find" command on the open/active
> window.  How would you get the "find" command in
> standalone Run-Rev program to focus on the active
> internet window to perform a search/find.

Several questions here.  First, I assume that by
> on the internet and had a page/window open
you mean having a web browser window open?

Given this, I am unclear whether you want to invoke the browser's Find
facility, or do your own in Rev?

In any case it will depend on the browser and platform.  On MacOS, most
browsers, you can use AppleScript to get either the contents of the front
most browser window, or at least the URL.  So given that in Rev you can
fetch a URL anyway, either way your Rev app should be able to figure out
what the browser is displaying, and do a find in it.  It's also trivial to
focus on the active internet window, if by that you mean bring the browser
window to the front.

Scripting the browser to use it's own Find mechanism, however, is less
likely to be possible - I've certainly not spotted this when scripting IE or
iCab.  There might be some browsers that support this.

On Windows you might be able to do something exotic with COM - or not.
Failing all this, you might be able to use hacks like QuickKeys or WinBatch
to get Rev to operate the browser's user interface.

Whatever you do, I very much doubt if it will be possible to make a general
solution - at best you can expect to get something that works for a
particular browser on a particular platform.
  Ben Rubinstein               |  Email: benr_mc at
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600        |  Fax  : +44 (0)1273-728866

More information about the use-livecode mailing list