Homer
This section quickly explains how to use Homer, the Homer scripts
lancher. The Homer executable lives in ~/config/bin/. It can be launched by
double-clicking on its icon, typing Homer in a Terminal. Because a link is added in
~/config/add-ons/Tracker, Homer can also be invoked as a Tracked add-on (by pressing ALT +
COMMAND + H).

The Homer window is split as follows:
- the "entries" view contains the list of the entries against
which the script will be launched. This list is initially empty unless you invoked Homer
as a Tracker add-on in which case the entries selected in the Tracker will appear in this
list. You can drag'n drop any additionnal entries in the window.
The "*" button is used to select all the entries in the list. The "x"
button is used to remove every selected entry in the list.
- the "iterator" view defines how the entries should be
iterated through.
"recurse directories" means that entries contained in sub-directories will be
processed.
"traverse symbolic links" means that... er... symbolic links will be traversed
"trace entries" tells the iterator to trace every entry which is processed in
the messages view below.
"stop on error" tells the iterator to stop as soon as an error is encountered.
(B_CANCELED is not treated as an error)
- the "scripts" view contains all the scripts that Homer
could read in ~/config/settings/Homer/scripts. You can select any script in this list, the
parameters will be displayed in the scroll list right underneath it. Parameters are
treated just like strings to be replaced in the script body at run time. The parameters
are referred to as $1, $2, ..., $9. See HomerEditor for
more details.
- the "messages" view just displays messages. This is the
target for ADD_HOMER_MESSAGE messages (see Homer messages)
The "*" button selects every message in the view.
The "x" button removes every selected message.
The "o" button minimizes the messages view if you're not interested in it, or
restores it if already minimized.
- The "Save prefs" button is used to save the current
configuration of Homer. The following information is saved:
- window's frame
- iterator options
- selected script
- The "Editor" button launches the script editor HomerEditor
- The "?" button displays information about Homer
- The "Quit" button tells Homer to quit
- The "Doh-it" button tells Homer to run the selected script
(if any) with the iterator options and entries.
One thing to note is that the scripts directory is monitored (with
the BeOS node monitor). This means that scripts which are or added to the watched
directory will immediately be taken into account, and scripts which are removed from that
directory will be removed from the scripts list. Script entries which are modified are not
yet taken into account. I know this would help a lot when fine-tuning a script.
One last thing about Homer. It loads Homer filters and commands at
launch time (these are not monitored). The add-ons are found in
~/config/add-ons/Homer/filters and ~/config/add-ons/Homer/commands.
That's it.
Screenshots
Here is a screenshot of Homer and Homer window after a script based
on GrepCommand has been launched. The script called "search for regexp" has one
argument: the regular expression to search. The matching lines of any input file in
displayed in the add-ons messages window.

Here is another screenshot for the ReplaceCommand. The script named
"replace email" has no parameter and was written to replace the email by my
address agautherot@hotmail.com. This is
performed only in files whose extension is cpp. The regular expression used to match the
email address is
[a-zA-Z_]+@[-.a-zA-Z_]+
As you can see, it took 6.28s to process 231 files. Pretty neat,
huh?

All right, enjoy now.
This page was last updated on 12/12/99.