Getting Started With AppleScript
What's AppleScript?
AppleScript is the programming, or scripting, language for Mac OS. It can be used with Finder and other applications that support AppleScript. Writing AppleScript is much easier than writing programs in other languages such as Basic, C or JavaScript. The language can be extended by applications that support AppleScript, thus making AppleScript a very powerful tool to control different applications.
The language used is very similar to written English, and it is very flexible, allowing different synonyms to be used. But, when learning AppleScript can sometimes be a bit tricky to find out the correct syntax to use it to its full power.
Allmost all scriptable applications support parts of the programming model recommended by Apple. One problem though, is that most application's AppleScript commands usually differ slightly, so one is often required learn how to script each application by trial and error and by reading or modifying other scripts.
PageSpinner is no exception, but there are several scripts included, so you may be able start with one of these scripts and try to modify it to suit your need.
AppleScript is one of the many great features available in MacOS as it enables you to have different applications collaborate to create powerful custom solutions.
To be able to use AppleScript you will need to have the following in your system's Extension folder:
- the extension named AppleScriptTM
- the file English Dialect in the sub folder Scripting Additions : Dialects.If you are having problems running PageSpinner's AppleScripts you could try to see if you can run other AppleScripts created with Script Editor, there are some scripts included with system 7.5 or later. If this still doesn't work you should install AppleScript from your System disks. AppleScript is included in System 7.5, but not in older versions of the System software, such as version 7.1. The AppleScript software can also be downloaded from the official AppleScript site (see below).
AppleScript Resources on the Web
Here is a list of links to resources on the web where additional information and online books about AppleScript can be found:
- AppleScript
The official AppleScript site
- The AppleScript Sourcebook
Bill Cheeseman's site contains a wide variety of information about AppleScript
- AppleScripts for Web Servers
at the CGI Resource Index, which also has programs and scripts in Perl, Tcl, C and other languages.
Books available online:
- AppleScript Language Guide: English Dialect
The definitive description of the English dialect of the AppleScript scripting language
- Glossary to AppleScript Language
The Glossary from the book above
- AppleScript Finder Guide
Learn how you can script the Finder
- AppleScript Scripting Additions Guide
Learn how to use the Scripting Additions included with the system
OSA Menu
If you find that there is not enough room in PageSpinner's Script Menu you can download and install OSA Menu extension, written by Leonard Rosenthol. OSA Menu is the essential tool for running AppleScript scripts.
Once installed OSA Menu adds a Script menu in the menu bar that enables you to run both universal and application specific scripts. OSA Menu creates a folder in your System Folder named "Scripts" and within this folder will be created a new folder for each application that you use.
If you write or download an AppleScript for PageSpinner, save it either as a compiled script or as an application in System Folder:Scripts:PageSpinner Scripts. You will then have the script available from the menu bar to add functionality in PageSpinner. OSA Menu will also give you the option to run scripts in Finder and lots of other applications that support AppleScript.
This gem can be downloaded from Leonard Rosenthol's Lazerware Web Site.
If these links above don't work you could check out the AppleScript support page at the PageSpinner web site.