Many people have toolsdaemon
or similar programs,
launchpads and the like. Selector is something quite different and can be used to work in conjunction with those types of programs or simply by itself. Selector is a simple command that takes its information from a text file. The text file uses commands native to Selector to easily set up buttons and requesters so you can quickly build an interface or a menu that does just about anything. You can even build ones that are dynamic and run Selector scripts that they make on the fly, like listing a directory and creating a set of buttons for the programs (see below). The program is so easy to use that you can have your first project up and running in under a minute. First of all, run the SelectorFont program to choose the font you want to use in your Selector projects. Now you need to copy the Selector command to your C: and then you need to open
|
a text editor. You can use the Amiga's
native Ed if you want. Simply open a
Shell and type "ed ram:test.sel
{return}" and it will open the editor
and create the file for you.
Now type in the following
commands:
Buttons have the power to load other Selector scripts or AmigaDOS scripts, which is what makes this so powerful. You can easily make a program that asks if you want to launch your custom programs each time you start up.
Move your programs out of your
WBStartup drawer into one called
Start. This is not a default drawer so
you can call it what you want as long as
you follow the name through in the
following example. Create a file in your
text editor called S:Programns.dos. (the
.dos isn't necessary, but it's useful for
remembering that this is an AmigaDOS
script rather than a Selector script). Now
type: |
We now have to write the Selector
script. Create a file called S:Programs.sel
and enter: Gap 6 Text "Welcome, Would you like to run your WBStartup programs?" Startbox Button "Yes" "execute ram:start.sel" Endbox Button "No" Exit and save this file. Now we can test it by typing into Shell "execute s:programs.dos
As you can see from the Seleclor
script, we've done some new things here.
We used the Gap command to say how
many pixels we wanted between each
button and we used the box commands
to put a box around the first button. To
make the script more powerful, go back
to the AmigaDOS script Programs.dos
and change it to:
Now change the Selector script
Programs.sel to: This script now has an extra button. The second line of the AmigaDOS script |
creates a new Selector script, which will
change if the contents of the directory
change because the Selector script is
created every time the AmigaDOS script
is executed. The AmigaDOS script
creates a line in a Selector script for each
program, inserting the button
command in for Selector so when you
click on the "Choose..." button in the
Selector run script it has a button for each
program. There is also the code in each
line to run the corresponding program. When you click on a button the program is run. You may not want to use WBStartup programs for this exercise as they are specifically designed to run from Workbench and we are forcing |
them to run from Shell, but you could
use part of this script for other things.
Use the part that lists the programs
for Selector buttons and choose a folder
containing your Utilities or Tools: Now enter the command line execute S:programs.dos (or whatever you called the script) into your Toolsaemon-type program. You now have a line that launches the DOS script to scan the Tools directory and then launches Selector to display whatever |
programs there are and the buttons for
them. If you add or remove programs
from that folder, you don't need to
change the script as it will do it for you. There are many more commands that Selector uses and you can do an amazing amount of interesting and varied things with it. For example, if you write your own Selector scripts rather than having them written on the fly, you can vary colours, headings, button types, use input and more. All the author asks is that you let him know you are using it and send him something. His address is in the documents with a list of all the commands and their uses, a beginner's tutorial and some sample files. AF |