frondoc picture
What is Frontier?
Download
News & Updates
Mailing Lists
Sample Scripts
Site Outline
Search
Guestbook
BBS
User's Guide
1 2 3 4 5 6
7 8 9 10 11
Apple File Edit
Main Open Suites
Web Window
Menubar Outline
Script Table WP

Frontier website on www.scripting.com

Recording

How to record scripts with applications that support recording.

Recording is so cool!

There are all levels of application scriptability, starting with apps that just support the four required Apple Events (not too useful) all the way thru applications that implement a well thought out set of Apple Events for scripting.

Recording is more than icing on the cake. Applications that support recording are truly outstanding scriptable applications. The developers who implement recording have made a very substantial investement in your productivity.

Recordability will be a rare feature, we believe, because it can require a very substantial amount of work for the developer. It can be more cost-effective for the developer to invest in more useful sample scripts and documentation than to implement the more impressive recording feature. And there's a cost to recordability, beyond the effort required by the developer: it takes up memory.

As often is the case, Aladdin Systems pioneered this new scripting technology. SITcomm 1.0, released in November 1993, is the first recordable Macintosh application.

Here's how recording works: if you want to find out how to do something from a script, just turn the recorder on, switch into the app, and do it. Recording is the "watch me" mode for Apple Event scripting. It's so cool to see it in action!

A demo...

For this demo, we're using PhotoFlash 1.0 from Apple Computer as the example application. PhotoFlash is not only scriptable and supports menu sharing; it is also recordable. A truly exemplary application.

First, it's very important to have the current Frontier install file for PhotoFlash. If you want to follow along, and you have a copy of PhotoFlash 1.0, be sure to get the current install file for PhotoFlash. Versions of PhotoFlash after 1.0 may include the Frontier install file on the distribution disk.

Here's the experiment:

  1. In PhotoFlash, create a new document window, and paste a graphic into it.

  2. Switch into Frontier, create a new script window. Click on the Record button.

  3. Switch into PhotoFlash, rotate the picture by 90 degrees, then flip it on its vertical axis.

  4. Switch into Frontier, click on the Stop button.

Here's the script Frontier generated:

with objectModel, PhotoFlash 
   bringToFront ()
   rotate (document [1], by: 90.0)
   flip (document [1], vertically)

You can easily convert this to a script that applies the same operation to a folder of files:

local (f)
fileloop (f in "System:PhotoFlash Work:")
   with objectModel, PhotoFlash 
      open (f)
      rotate (document [1], by: 90.0)
      flip (document [1], vertically)
      close (document [1])

Recording AppleScript scripts works equally well in Frontier 3.0. Here's the first recorded script, with AppleScript selected as the scripting language:

tell Application "PhotoFlash"
   activate
   rotate document 1 by 90.0
   flip document 1 direction vertically
end tell

Rules & Strategies for Recording


© Copyright 1996-97 UserLand Software. This page was last built on Wed, Jan 22, 1997 at 3:07:26 PM with Frontier. Thanks for checking it out! Dave