Buy ScriptDB

ScriptDB demo

Getting started tutorial and manual

Contact us



 

Read about ScriptDB in this new AppleScript book!
written by
Hanaan Rosenthal
technical editing by
Bill Cheeseman

Click here to read about the book and download hundreds of related scripts.

Click here to order the book from Amazon.com

ScriptDB is now Intel-optimized!
Download the Intel-compatible version here.

Known bug in Intel version: When specifying the records to delete with the db delete command, use a number in a string to specify the record to delete instead of using an integer.

ScriptDB Leopard compatibility

At the moment, ScriptDB has some compatibility issues with OS X 10.5 Leopard. Some of the issues is specifying fields for various commands.

What is ScriptDB?

ScriptDB is a scripting addition that extends the capabilities of AppleScript and AppleScript Studio with a simple and powerful set of database commands.
ScriptDB allows you to take data stored in AppleScript lists or text-files and convert it into a ScriptDB class database.
Once the data conforms to the ScriptDB class format, you can perform database operations on your data using in AppleScript, right inside your scripts.
Best of all, the property containing the actual data is a simple list of lists so that you always have complete access to it.

How can I purchase ScriptDB?

ScriptDB is a commercial product. You can try it out if you want, and then pay for it if you want to keep on using it.
We intentionally made ScriptDB very affordable. We think it has a wide appeal so we didn't want anyone to not get it because of price.

ScriptDB and FileMaker Pro

We love to use FileMaker Pro and we bet you do too. We designed ScriptDB to be able to import and export FileMaker Pro data using XML.


Buy a ScriptDB license Now from kagi
Download ScriptDB Demo


What operations can be performed with ScriptDB?

Once a database has been established in ScriptDB's memory (using the DB Create command), you can add records, remove records, add fields, remove fields, sort your data and perform both simple and complex searches.

Who should use Script DB

ScriptDB is for everyone. While Script DB can perform powerful database operations, its real beauty lies in its simplicity. You can take a few lists, quickly turn them into one database, and then sort them, extract data from them based on criteria, or just export them to a file for later use.

Is there an actual database file?

The database used by SeciptDB is held in memory for as long as the script is running. You can load text from either a tab delimited file or xml files created by either FileMaker or exported by ScriptDB, but until you use the DB Save command, all operations happen in memory.
ScriptDB was not meant to replace your database, just to allow you to perform the database functions your script calls for.

What are the benefits of using ScriptDB?

As any scripter knows, a database can be any collection of orderly data. In AppleScript we use lists and records to manage that data. We collect data into lists or records, and then create complex subroutines that help us use the data in ways such as sorting it, finding matches, etc.
ScriptDB is here to make all these aspects of scripting easy to manage and fast to run*.
Here's a simple example of ScriptDB's power: Imagine having a database of sorts or a spreadsheet containing data you need to use in a script. You get the data into a few lists, but from that point on, it is your job to keep the data in the different lists synchronized.
Imagine for a second that the different lists are a database where each list is a field and the corresponding items in each list make a record: item 1 of each list is record 1, etc.
You can use a repeat loop to extract the data quite easily, but if you want a sub-set of this data, or you want to sort all lists based on the sort order of one of the lists, forget about it. You will need to go back to the source and try to perform some operations over there and get new data.
With ScriptDB you retrieve all the data you need for the script once and perform all database operations right in AppleScript.

The ideal companion for AppleScript Studio

If you’ve worked with AppleScript Studio, you know how great it is to create table views and connect them to data sources. But if you want to manipulate the data in the data source, you're out of luck.
With ScriptDB you can quickly find data subsets, sort the data by multiple fields, and best of all, you can hold extra fields in the ScriptDB database that you don't want to show, and only furnish the table with the number of columns it can hold.
In addition, you can use ScriptDB's XML save and load
feature to store and retrieve database information in files.

The ideal companion for MacSQL

If you worked with MacSQL before, you know that it is great for performing commands on SQL databases. With ScriptDB you can take this data and sort it, get subsets of it and perform any other database operation allowed by ScriptDB

Ideal situations for using ScriptDB

Anytime you struggle with managing multiple lists in your script, ScriptDB can help you.
Imagine getting data from a spreadsheet, from FileMaker Pro or better yet, from an enterprise SQL database. Once you got that data in, ScriptDB is your best shot at using that data in your script.

How does ScriptDB work?

ScriptDB relies on the ScriptDB class and database commands for its functionality. The ScriptDB class is essentially a souped-up list of lists that is recognized by the commands in the scripting addition.
Each command takes a ScriptDB class object (usually one that is stored in a variable) and returns a ScriptDB class object. That means that most commands work a bit like this simple command: set x to x + 1. You take a database and make a change to it, the result is another database. For instance:
Set my_db to DB Sort my_db by {"zip", "creation date"}
You can assign the result to the same variable you use as the db parameter, or, you can create a copy of the database with the changes brought on by the command (sort, in this case).
The DB Get Data command is one of the most versatile commands, and the only one that does not return a database by default. With the DB Get Data command you can extract data from the database in one of many ways, and have that data returned to you as a list of lists, as a list of lists transposed, as a list of record numbers that match a criteria, or as a ScriptDB class like all the other commands.

How long does it take to get up and running?

One of the goals we had when we designed ScriptDB was to make any scripter pick it up and use it right from the first command. Sure, you will need to keep the reference-manual handy, especially due to the large number of possibilities, but getting what you want done right off the bat is easy.

*Speed is a factor of Mac's processor, the number of records and fields in a database, and the operation performed.
ScriptDB is ideal when working with under 1000 records with several fields, or with several thousands of records when managing two or three fields.