

Script tools are one of the most exciting new features in Sketchpad 3.0. They
allow you to convert any construction you make into a reusable drawing tool added
to the program's toolbox. So while you begin with a compass and straightedge, you
can rapidly develop a set of drawing tools to match your specific application;
and as your geometric vocabulary grows, so does your toolbox.
To use script tools, first you need script documents. Many of the documents in
the Sketchpad 3.0 Gallery are scripts, which you can download by clicking the
appropriately links. To make your own scripts, follow the instructions in the
User's Guide. (The easiest way is to create a construction in an otherwise blank
sketch. Then select the entire thing, and choose Make Script from the Work menu.
Then use the File menu to save your script with a unique name to your hard disk.)
Setting up your Script Tool folder
Put all the scripts you want to use as drawing tools into the same folder or
directory on your hard disk. Give this directory a name like "Tools" or "My
Scripts". If you have lots of scripts, you may want to organize them into
subfolders in this directory.
Once the scripts are in a common directory, you need to tell Sketchpad where this
directory is. Go the Preferences dialog box, and click on the "More" button.
You'll see a configuration panel like this:
Right now, no directory (or folder) is set, so click the Set button. Then, in
the standard file dialog that appears, locate the directory or folder which
contains your script tools. In the following example, I've told Sketchpad that my
script tools are in a folder called "Misc Sketches" that lives on the desktop of
my hard-disk, Scrofule.
Bravo! That's all there is to it. This setting will last after you quit
Sketchpad, so the next time you come back, all of these tools will still be
available. To add new tools, simply drop new script documents into the Script
Tool folder or directory.
Using Script Tools
Each of the tools in your Script Tool folder appear in a pop-up menu available
from the "script tool" icon which appears in your toolbox once you've set a tool
folder.
![[Script
Tool Icon + Menu]](tools/stmenu.gif)
When you choose a tool from this menu, it becomes the active drawing tool: click
and drag in your sketch to use it, just like you do with the compass and
straightedge tools. The status box in the lower-left corner of the sketch gives
you prompts about to click, which can be useful if you've never used a given tool
before.
Be sure at some point to try setting the "Sample Scripts" directory that was
installed with Sketchpad as your active Script Tool folder. This will give you
access to more than 50 new tools, ranging from regular polygons through canonical
constructions (e. g. centroid of a triangle) and fractals to graphic effects
(arrowheads, angle marks, etc.).
What can go wrong?
If you encounter any problems, check the following list of solutions. If the
answer's not here, be sure to consult your User's Guide.
- There's no "More" button in the Preferences dialog box!
Whoever owns the copy of Sketchpad you're using has previously set things up they
way he or she wants to, and doesn't want you messing with it (by changing the
Script Tool folder, for example). Ask them to deprotect More Preferences for
you. If you've protected it yourself and don't remember how, consult your
User's Guide.
- I set the folder, click on the icon, and nothing happens.
If you have a
lot of scripts in your directory, it will take Sketchpad a little time to scan
them all before it can make them available. You can speed this process up by
clicking and holding the mouse on the tool icon. (You'll see the words
"Scanning Script Tools..." flash in the status bar as you do so.)
-I set it up, everything worked fine, but when I quit and came back, it had
forgotten about my folder.
You're probably using the Demo version of the program, which doesn't save its
settings between uses.
On Writing and Sharing Scripts
If you make your own script tools, you'll probably want to share them--with your
classmates, teachers, students, and colleagues; or with the on-line community.
If you do so, remember that nobody but you knows what your script does, how it
works, or why they should use it. Here are some guidelines you might want to
follow to help make your scripts effective at communicating their purpose:
Write a Comment
With your script window foremost, choose Show Comments from the Edit menu. This
displays an area in which you can type information about your script--what it
does, why you wrote it. This is a great place to put your name and e-mail
address, too! When people use your script as a script tool, this comment will
show up at the bottom of their screen, providing them useful information about
what to do with the tool.
Label your Givens
Sketchpad assigns default labels to the given objects in your script. If these
objects play specific roles in the script's construction, it's a good idea to
give them more meaningful labels than the ones Sketchpad generates. For instance,
"Point A" and "Point B" aren't very meaningful. But "Point Endpoint#1" and "Point
Endpoint#2" are more so: they tell us that these objects represent the endpoints
of a segment. You can change the label of any object in your script by
double-clicking the line it appears on in the script window.
Organize your Givens
If your script has lots of given objects, be sure they're ordered in a logical
fashion. For instance, if your script takes six points as the vertices of two
independent triangles that it's going to construct, it makes sense to have the
first three givens be the vertices of one triangle; and the next three the
vertices of the other. If you don't like the order that Sketchpad assigns to your
givens, you can rearrange them. To do this, click on a given object in the list
while holding down the Option key (Macintosh) or the Shift key (Windows). Then
drag the given object up or down, to where you want it to appear in the list.
There's lots you can do with scripts and script tools. Be sure to check your
User's Guide for more details.
Return to the Foyer.
Sketches, scripts, and web pages by Bill Finzer
and Nick Jackiw.