The following is a brief excerpt from the SenseTalk documentation.
Copyright © 2001-2003 Thoughtful Software — All Rights Reserved

Scripting with SenseTalkTM


SenseTalkTM is a remarkably English-like language that enables you to communicate with your computer to harness its power and abilities in a refreshingly easy and understandable manner. SenseTalk provides access to the full range of capabilities inherent in your computer while remaining easy to learn and understand. It achieves this by leveraging the powerful concepts behind many words which have become buzzwords in the computer industry. Stated in today's technical jargon: SenseTalk is a very high level, object oriented, interpreted scripting language, based on a modular, extensible architecture.

So, in plain English, what does that really mean?

SenseTalk is "object oriented" because thinking about objects is a natural and understandable way to describe and deal with potentially complex systems. We deal with "things" daily in our lives, whether they are tangible things like a telephone or a bottle of water, or intangible things like our bank account or our child's soccer schedule. With SenseTalk you can create "objects" in your computer which represent each of these things.

SenseTalk is considered a "very high level" language because it can do a lot with very few words. High level commands make your job easier. Suppose you have a list of names that you would like to sort into alphabetical order by last name. In a lower level programming language you would need to write instructions to find the last name by locating the last space in each name, and then write many more instructions to carefully rearrange the names alphabetically. In SenseTalk you could simply give the command "sort the lines of nameList by the last word of each" and be done with it.

As an "interpreted scripting language", SenseTalk is very responsive, providing immediate feedback as you learn the language and try out new commands. You can type commands or partial scripts and have the computer carry out your instructions at once.

And SenseTalk's "modular, extensible architecture" allows you to add new commands and functions to extend the range of what SenseTalk can do. The language is not cast in stone, but can grow and evolve according to your needs. The underlying structure has been crafted to support new and changing requirements as computer capabilities advance and your knowledge and understanding grows.


To put it simply, SenseTalk is an English-like language that lets you tell your computer what you want it to do. You do this by creating software "objects" that organize the information you want to work with in understandable ways, and writing "scripts" that describe how you want each object to behave.

You could think of it as being a little bit like writing a play. You create a cast of characters, and provide each of them with their own script which defines their role, and how they should respond to various messages which might be sent to them. Unlike a play, though, the action doesn't have to follow the same sequence every time the script is run. The characters (objects) interact with one another and with the user of the system (you) by sending and receiving messages.

A message may tell an object what to do, or provide it with information. When it receives a message, it may respond in different ways at different times depending on what else is going on in the system at that time. It all depends on what the object's script tells it to do. Each object has its own script -- its own set of instructions to follow -- and the instructions are written using the SenseTalk language.

SenseTalk was originally created as the scripting language of HyperSenseTM, Thoughtful Software's powerful authoring system. While some examples and descriptions in this manual may refer to HyperSense objects or other features of that system, SenseTalk also stands alone as an independent scripting language. This manual aims to describe the SenseTalk language separately from any particular environment in which it might be used.

A Brief Taste of SenseTalk

Okay, we've been blowing our horn about how easy and powerful and understandable SenseTalk is, but maybe you'd like to see a quick example or two of what we're talking about. How does it really compare to other languages?
Here is an example script written in Perl, which is quite possibly the most popular scripting language in the world today. This script is taken almost verbatim from a popular book written by Perl experts (the "Perl Cookbook", p. 247). We'll explain what it does in a moment.
sysopen(FH, "numfile", O_RDWR|O_CREAT)
							or die "can't open numfile: $!";
$num =  || 0;			# DO NOT USE "or" THERE!!
seek(FH, 0, 0)				or die "can't rewind numfile: $!";
truncate(FH, 0)			or die "can't truncate numfile: $!";
print FH $num+1, "\n"		or die "can't write numfile: $!";
close(FH)					or die "can't close numfile: $!";
Now, for comparison, here is a SenseTalk script which accomplishes the same thing (maybe this will help you understand what's being done):
add 1 to file "numfile"
Okay, is it becoming clearer now? The purpose of both scripts is to increment (add one to) a counter which is kept in a file called "numfile". The purpose of this comparison is not to bash Perl, which is a very powerful language used extensively by system administrators, but to point out the advantage that SenseTalk offers for scripters whose needs are perhaps less rigorous but who just need to get something done quickly and easily.

To be fair, there are probably ways to shorten the Perl script somewhat, and SenseTalk offers longer ways of doing the same thing which might be more comparable. Here is another script in SenseTalk which does the same thing, following more closely the approach used in the Perl script:
open file "numfile"
read from file "numfile" until end
put the first word of it into num
seek in file "numfile" to the beginning
write num+1 & return to file "numfile"
close file "numfile"
If you eliminate all of the "or die" parts of the Perl script (which are just there to be very careful about reporting mostly unlikely errors) you'll see that the SenseTalk script is now slightly longer than the Perl version. But you'll probably agree that the SenseTalk script is also much clearer, easier to read and understand, and also easier to learn and remember. Because it is so much more readable, it is also easier to find and correct mistakes, or to make changes to a script you wrote several months earlier if you decide it should do something slightly different.

Okay, that's enough of an introduction to give you some idea of what SenseTalk is about and what we're trying to achieve. Now it's time to dig in and learn something about how it works and how to use it.