Why Ukelele?
============

Why not? It's got lots of 'e's and 'l's in it.

What does it do?
================

It does not, as some have suggested, play a musical instrument. Neither does
it, as some others have put forward, do George Formby impressions. Oh no.
Ukelele will find and run applications for you. Obvious really.

Ukelele complements the File Finder in that it's job is quite similar.
However, ukelele attempts to make intelligent guesses about what it is
you think you are searching for, rather than just beleiving you. Ukelele
is for all those times (I have them a lot) when you know you have an
application for doing something but you don't know what it's called.

Run Ukelele and a window opens. Easy so far. There are a few icons in this
window. Don't worry about them yet. Just click on the small one that makes
the mouse pointer change to a picture of a drop-down menu when you move
over it. Cor! A menu opens. There are lots of entries in this menu, like
'Word Processor' and 'Text Editor'. Try selecting one and clicking on the
'OK' button in the window. Be amazed as an appropriate application magically
appears on the iconbar.

If this doesn't work for you then don't fret, it isn't you, it's your
computer.

So How Does It Know?
====================

[12]
Don't worry, you don't need to know. You CAN teach it applications, but
that's too advanced for the likes of you.

[34]
OK, so I cheated. The program's not clever enough to sort out what
applications do just by looking at them. I told it before. And you can too.
OOhhhh!

Inside !Ukelele is a file called 'Aliases'. Have a look at this, it's very
exciting. Let's take a look at one portion of this file:

Text Editor
TextEditor
!Zap
!Edit
!DeskEdit
!StrongEd

The first line is what appears in the menu. The second line is an alternative
Alias name. You can have as many alternatives as you like. I'll explain what
they're for below.

After the Aliases, there is a list of application names. What Ukelele does
when you ask it to find 'Text Editor' is that it searches through your hard
disc for one of the named applications. The one it finds first will be the
one it runs for you.

You can set up quite a few of these definitions in the Aliases file. There
must be a blank line between each defintion, and the file MUST end with at
least TWO carriage returns.

[1234]
Anything Else?
==============

Oooh yes, loads.

Like, what do all those white (writeable) icons do?

The first writable icon is 'Search From' - this is the pathname where the
search for applications will begin. This should be automatically set to the
root directory of your hard disc. Change this if it's not correct.
[4]
(The program takes its default search path from System$Dir.)
[12]

The second one is 'Search For'. In here you can type something. Ukelele
will then try and search your hard disc for a program that looks as if it
might do what you want. So if you want to look for a wordprocessor, you
could either select 'Word Processor' from the menu, or you could type
'wordprocessor' in the Search For box.

Or suppose you had an application that you thought was called 'Rhubarb', but
it might have been 'rhoobarb'. You can't be bothered to look all the way
through you hard disc, can you? Just type 'barb' into Ukelele, and it'll
have a look for you for something called something like 'barb'.

Note that it's not all that clever really. If you type rbb, don't expect it
to find something called rhubarb. I'm working on that one. You could use
the File Finder for that, but that would require a little intelligence.

As another example, suppose you want to find a program that can edit sprite
files. Just type 'Sprite' into the search for box, sit back, and wait.

Or suppose you wanted to find an application to draw graphs. Just type
'Graph' into the the search for box. It's quite possible that Ukelele will
find an application for you.
[34]

The second one is 'Search For'. In here you can type something to search for.
If you type an application name (e.g. something beginning with a "!", then
Ukelele will search ONLY for that named application. If you type one of the
aliases in the aliases file it will search for one of the applications
matching that alias. Remember that you can have more than one application
associated with a group of aliases. If Ukelele can't match what you typed
with one of its aliases, it then looks for a close match, i.e. if you
typed 'editor' and had only the aliases 'Text Editor' and 'Draw' defined,
Ukelele would take 'Text Editor' to be what you want to look for and will
search for one of the applications matching that alias. If all else fails
and it can't match an alias to your typing, it will hunt for an application
whose name contains what you typed.

If all that fails, it will look to see if what you typed in can be matched
to a filetype (e.g., you might have typed 'Sprite'). If it can match it to
a filetype then it will try to find and run an application that can load
Sprite files. It does this by first looking to see if there is a RunType
variable set, then going through each application on your disc in turn
looking for an entry in its !Run or !Boot file containing either a File$Type
Description, or an Alias$@RunType description, or a line containing the
text that you typed.

Note that the text you type can contain wildcards. If it's an application
name, you could type, e.g., !*barb to find something called !Rhubarb. Even
R*b*b would probably work.
[1234]

Note that anything you type into the 'Search For' box is treated as being
CASE INSENSITIVE, i.e. EdItor is equivalent to editor (or even EDITOr).

The third icon is 'Run With'. In here you can type something else. Such as a
filename to be passed to the application so it starts with a file loaded.

Click OK to start.

[34]
There is another text file in the Ukelele directory which is called "Ignore"
In this file there are some more words. These are names of directories to
ignore whilst searching for Applications - i.e. these directories will not
be searched. This speeds thigs up a lot.

[4]
Technical Bits.
===============

The hard work is all done by the program FindRun. This is a small BASIC
program which can be run using command line parameters. Ukelele calls this
program when you ask it to look for an application. It does not call it
directly, but actually does so via an Obey file called StartTask. StartTask
sets a 32K WimpSlot, then passes the parameters on to FindRun. The systax is:

StartTask -f <appname or alias> [-d <pathname>] [-i <expression>]

where -f specifies the thing you want to search for. All aliases defined in
the Aliases file can be used.
-d specifies a start pathname. If you don't specify one, FindRun defaults to
the root directory where !System is held.
-i specifies a parameter to be passed to the application when it is found,
such as a filename.

Other Uses.
===========

One thing you can use FindRun for is as an alternative way of defining
RunTypes.
All you need to do is:
  1) Ensure that !Ukelele is 'seen' on booting up the computer.
  2) Copy StartTask into your Library directory.
You can now set up an Alias$@RunType_XXX variable which does not require any
knowledge of where the application is or even what it is called, eg:

 Set Alias$@RunType_FFF StartTask -f text editor -i %*0
 
This sets the default run action for text files to be to call StartTask to
look for a text editor. The -i %*0 passes the name of the text file to the
editor. Once the editor runs, it will reset this system variable to point to
itself.

I don't know if anyone will find this useful, but it's possible and it works
so I thought I'd tell you about it.

If anyone finds a use for this program, please let me know.

[1234]

Public Domain Notice:
=====================

The public domain restrictions on Ukelele are a little different from the
main Black Hole program:

Ukelele is phase 5 of Fat German Productions' increasingly unlikely plan for
world domination.  This software is released by assent of the Fat German who
is in no way related. The Great Green Golloywog was not involved in the
production of this program because he was little off colour at the time. He
was ably deputised by the Creepy Creamy Cretin Crusher, who wishes it to be
known that nothing in this program has anything whatsoever to do with him.

This software may be freely distributed by whatever means you deem
appropriate to any part of the known universe (except 25B, Mandelaby Road,
Wandsworth because their garage door is a foul colour) so long as the
following conditions are met:

a) That this notice is distributed unchanged with every copy.
b) That the application is supplied with unchanged versions of all files.
c) No charge is made for the distribution. Public domain libraries may make
   a small charge to cover distribution costs. It is highly unethical, not
   to mention dishonest to make a charge for software which programmers
   have intended to be freely distributed, especially if none of that profit
   finds its way to the programmer.
d) That you all strive to listen to at least one Beatles album every day.
e) !Ukelele may be distributed separately from the main Black Hole program.
f) Black Hole may NOT be distributed without !Ukelele.

All copyright is reserved. You may not use any part of this application in
any project which is to be sold for profit without my express permission
in writing.

None of the files contained inside !Ukelele may be distributed separately
from the application.

If you wish to use pieces of my code in your own pd programs then please feel
free to do so, provided these programs are not intented for sale.
I say this mainly because my telling you not to do so would not stop you, but
also becasue I learned programming by nicking and splicing bits of other
people's programs, so why shouldn't you?

If you do use my code, a credit would be nice. Money would be even better.

Fat German Productions,
122 Miswell Lane,
Tring,
Herts. HP23 4EU
England

email: mgreenwo@madge1.demon.co.uk

                         Fat German Productions 1994
