Washington Apple Pi

A Community of Apple iPad, iPhone and Mac Users
A Review of OneClick and PreFab Player
by Paul J. Chernoff
© 1997, Paul J. Chernoff

Washington Apple Pi Journal, reprint information

OneClick and PreFab Player address the goal of sophisticated desktop automation. OneClick is a complete development system with palettes and its own scripting language while PreFab Player works with AppleScript and UserLand Frontier. Deciding which is best will be determined by your particular needs and your experience with AppleScript.

In the old days there were two ways to automate your Macintosh, QuicKeys1 (see sidebar) and Tempo2. QuicKeys is powerful but is limited by its shortcut structure (see sidebar) while Tempo--currently available as Tempo II Plus--has fallen below the radar screen. Most modern macro program work like these two programs, they control the computer by simulating user actions such as clicking on a button or selecting a menu item. They do not directly talk to the applications. The high degree of success of macro programs is due to the Macintosh's consistent user interface and the Macintosh Toolbox, two issues beyond the scope of this review.

AppleScript and Frontier introduced a revolution in Macintosh automation by introducing direct application control coupled with a full-fledged scripting language. While OneClick does a Find & Replace action in BB Edit3 by calling up the Find dialog box, filling it in and clicking on the action button, AppleScript does the same by sending a command directly to the application, such as replace Every Occurrence searching for "John" using "Peter" with case sensitive, entire word and start at top. But while AppleScript is part of System 7.x most programs do not support it.

PreFab Player

Because AppleScript only works with applications which support AppleScript I was not able to use AppleScript to control QuarkCopyDesk, Quark's word processing program. That is where PreFab Player comes in. PreFab Player is an extension/application which enables AppleScript to control non-AppleScript savvy programs in a manner similar to traditional macro programs while retaining AppleScript's other features. PreFab Player also includes some development tools.

Like any application support AppleScript you can call up PreFab Player's dictionary with Script Editor. PreFab Player runs in the background and is a faceless application. It can only be controlled through AppleScript and Frontier. Upon receiving a command, such as "click button" or "get info popup", it then performs an action on the front most application. PreFab Player commands can be divided into 3 categories.

The first category is actions. "Click dialog item" sends a command to the front most dialog box for one of its items to be clicked. The item clicked can be defined by its name, ID number or XY location. Optional parameters for this command include modifier keys (i.e. command/shift/option/control/caps lock) to be held down, the number of times to click and the exact location within the item (useful for targeting one of the arrows in an up/down arrow control). Each PreFab Player action enables an item to be identified by name, ID number, or x,y coordinates, which is vital were a dialog box has multiple checkboxes with the same name (see figure X). QuicKeys identifies objects by name only and does not work with some of the QuarkCopyDesk's Find & Replace dialog checkboxes (see Figure 1's).


Figure 1 -- QuarkCopyDesk Find & Replace dialog with identically named checkboxes.

The second category is information gathering. Is a button enabled? Does a given window exist? Is a checkbox in a dialog box checked or unchecked? The results can be used to drive the script's actions though if...then statements and loops.

The third category is programming tools. PreFab Player includes commands which would be used by a programmer in writing a script. For example, Outline Dialog results in a list of all of the items in the front most dialog, including item names, IDs, x/y coordinates and sizes. Outline Menu returns an outline of menus in the front most document.

In addition, PreFab Player can call up item information and X,Y coordinates based on the cursors position within the window. To look up information press control-option-?.In Figure 2 we see that the name of the Find field is "User Item," it is item #5 and the mouse is at coordinate 133,30 for the window.


Figure 2 -- cross hair cursor with location display.

I have found FPF to be stable and to work with with "non-standard" applications. For example, while QuicKeys chokes when trying to select an item from a submenu in QuarkCopyDesk FPF can do it with no problem. QuicKeys fails due to Quark products implementing menus in a nonstandard way. FPF has been designed to work with Quark products because many of PreFab's customers and in the publishing business.
PreFab Player is not recordable. You must type in all commands. However, I have found that FPF's documentation and programming tools makes it easy enough to use for those with prior AppleScript experience. And since FPF is an add-on to AppleScript, it works well with other AppleScript extensions and AppleScript based development products such as FaceSpan.

PreFab Player is $95 for the programmers kit and $20--$25 per runtime license. A 30-day trial version can be downloaded. PreFab Player will work with both AppleScript and UserLand Frontier.

OneClick 1.02

OneClick has depth. The more you use it the more you will appreciate its richness. What seems at first to be a way of creating shortcuts activated through palettes proves to be a complete automation system. OneClick's scripting language and palette tools allow for many opportunities to make a Macintosh easier to use.

Palettes

Palettes are at the OneClick's heart. Not only are they the prime method for triggering actions but they also form as a sophisticated method for organizing scripts. All OneClick palettes float above all other windows.

Special Palettes

OneClick provides some special palettes. While customizable they each have characteristics not shared by normal palettes.
The first palette is the Launcher Palette (see Figure 3). It is a global palette designed for launching applications, documents, and folders. To add a file or folder to the palette just drag it onto the palette's target square. In addition to opening a file by clicking on its icon, you can open a document by dragging its file on top of the application's icon. Clicking on the checkbox opens a configuration menu (see Figure 4). In contrast, QuicKeys palettes do not support drag and drop and are more difficult to configure.


Figure 3 -- OneClick Launch Strip

Figure 4 -- Launcher configuration menu.

The System Bar resembles the Macintosh Control Strip. Again, the user can reconfigure this palette. Since OneClick supports Apple's control strip panels it can complete replace Apple's version. Plus the panels can be used with any palette. The System Bar can also be shrunk to a single icon in one click. And for better screen co-habitation it can automatically hide until the mouse is brought over the Control Strip, just like Windows 95's start bar.


Figure 5 -- The Control Strip

The Task Bar shows all open applications. It also provides a list of recently opened applications, and provides easy access to the Launch Strip. Clicking on an application's icon makes it active.


Figure 6 -- The Task Bar

Roll your own palettes

In addition to the prefabricated palettes you can create your own. Any palette can be either global or application specific. An application specific palette is only visible when its associated application is active. Any application can have multiple palettes, which can be useful if one or more palette is to be kept invisible.

Palettes are made up of buttons. The two main types of buttons are regular buttons and button menus. The former are what you expect: you click on them or drag an object on them and they perform an action. Button menus are actually popup menus.

To avoid clutter you can have a button act as a palette popup. for example, if you click on the Text Tools palette popup button in the following ClarisWorks palette, it bring ups up another palette of text related buttons (see Figure 7). This provides a rational way to organizing multiple macros without resorting to huge palettes.


Figure 7 -- ClarisWorks palette "popping up" the Text Tools palette

The OneClick Editor allow for customization of OneClick. The editor has a series of tabs (see Figure 8), each tab turns to a particular editor. The editor's Palette tab is for setting up and modify palettes. A popup menu allows you to select any global or active application palette. You can control palette size and location by either entering numbers or direct manipulation. If you want the buttons to fit in a standard grid you can define that. In addition to setting background colors you can also have a background image. The title bar is option, as is displaying the palette in the OneClick menu.


Figure 8 -- OneClick Editor, Palette Tab

The editor's Button tab provides control over button appearance. In addition to setting button appearance and position, you can decide if a button is identified by an icon or text label, its associated balloon help. Each button can also have an associated key equivalent. This key works even if the button's palette is invisible but active. So if you prefer using the keyboard to activate macros and hate buttons OneClick can be your macro program.


Figure 9 -- OneClick Editor, Button Tab

Buttons can be modified by scripts, so the truly clever can have palettes and buttons reconfigure themselves according to context. Each button can have up to 4 icons, which are then selected via scripts.

If you want icon buttons OneClick provides a large number of icons. If you want to steal another programs icons click on the Icon Search tab. It pulls icon resources from any file. The OneClick Editor has an Icon tab for those with some artist talents.


Figure 10 -- OneClick Editor, Icon Search Tab

Figure 11 -- OneClick Editor, Icon Tab

Scripting

OneClick has a rich scripting language that allows for deep access to your Mac. The language provides all the basic control structures such as if..else..then statements and loops. It parallels many AppleScript features such as standard dialog box creation and Finder control.

Since some people find text-based scripting languages too scary, just too much like programming, it is very important that OneClick is recordable. This means that OneClick can record your actions in a script. It provides an important start for learning the language even if it does not pick the best commands for duplicating what you did manually. I find that all scripting systems require that computer generated scripts be tweaked by hand. The recording feature gives OneClick a big advantage over KeyQuencer and the AppleScript/PreFab Player combo.

One advantage of OneClick over QuicKeys is that the former supports variables. You can do equations and conversions and easily branch actions according the current situation. OneClick supports both local and global variables. Local variables are valid within a script. Global variables must be declared in every script they are used, and they can be accessible from every script.

OneClick supports subroutines not parameter passing. You must declare global variables if you want to transfer values from one script to another. A "subroutine" is just another script assigned to a button. While you must create a button for every subroutine your user interface does not get message because you can assign the subroutine scripts to either invisible buttons or buttons on invisible palettes. A script can be called from another script even if their buttons are on different palettes.

The scripting editor is competent but very basic. No find & replace function, no differention syntax by color. But it provides help in the form of a list of commands and detail description of each command. It also tracks labels, performs auto indentation and allows for recording within a script. You can also put up a list of items in the application's front most window in the Parameters popup menu.


Figure 12 -- OneClick Editor Script tab

OneClick does have its quarks and undocumented features. At first OneClick was stumped by QuarkCopyDesk's Find & Replace dialog box (see Figure 1) but I entered a number instead of the item's name when two items shared the same name. This technique worked even though it is not documented anywhere.

OneClick is not OSA compliant. This means that you cannot write OneClick scripts in an AppleScript editor. But OneClick includes AppleScript extensions so you can have an AppleScript run a OneClick script and visa versa. And you can do limited AppleScripting within OneClick. In addition AppleScript and OneClick script can exchange variables.

As mentioned above, OneClick scripts can control the OneClick environment. A dedicated script writer can use OneClick to build custom solutions for others.

Learning the language is easier than AppleScript. The language is more consistent than AppleScript. The scripting manual is well written. It is included as a PDF file with OneClick, a hard copy of the scripting manual is an extra $10.

Development tools

OneClick comes with additional materials. In addition to providing a number of sample palettes they also supply a Library function to the OneClick editor.


Figure 13 -- OneClick Editor Library tab

I find OneClick to be an ideal automation tool. While lacking parameter passing its palettes proved to be far more powerful than I expected. I was originally concerned about its support for people who want to do everything via the keyboard, but by allowing for palette hiding a set of macros can be all keyboard driven without using and screen real estate, just like the original QuicKeys. And the palettes prove to be useful organizing tools, where you can create palettes just for the sake of holding subroutines.

Unfortunately I had to pass up OneClick for my office due to a conflict it has with Adobe Type Reunion 1.2. WestCode is aware of this conflict but no date has been announced for a fix. I have had no conflicts with NOW WYSIWYG and I have not yet tested ATR 2.0. I am also concerned when OneClick will be updated. I remember hearing a year ago that version 1.5 should be out soon, but I have not seen it. On the positive side WestCode is actively promoting OneClick and supports it on their web site.

Summary

OneClick is an impressive product. With the exception of its lack of parameter passing I consider it to be the closest to a development environment. Its complete scripting language coupled with its palette prowess makes it the winner in my eyes. The writers must have thought "how do we allow people automated control of their Macs while making it fun and Macish?" OneClick is suitable for neophytes; the ability to record and simple actions make it suitable for those interested in simple automation.

PreFab Player is a solid product. While its abilities are more limited--no palettes, graphic tools, libraries--its real job is to expand AppleScript. If you use AppleScript you might find Player your best investment since it builds on your AppleScript skills and tools and provides some tricks for finding information necessary for writing scripts. For example, you can write a program with a standard Macintosh interface in FaceSpan and use it to control non-scriptable application via PreFab Player. Player makes AppleScript more usable. Its biggest drawbacks are that it is not recordable and you should first learn AppleScript basics.


PreFab Player 1.1
$95 a package, $20-25 per runtime license
PreFab Software, Inc.
288 Littleton Rd, Suite 20
Westford, MA 01886
Tel: 978-692-1256
FAX: 978-692-1259
E-mail: player@prefab.com
Web: http://www.prefab.com

OneClick 1.02
$50-112 depending upon sidegrades, special offers and volume discounts
WestCode Software, Inc.
15050 Avenue of Science, Suite 112
San Diego, CA 92128
(619) 487-9200
Fax: (619) 487-9255
Web: http://www.westcodesoft.com

Paul Chernoff is the Systems Manager for the Washingtonian Magazine. He has been a Mac owner since 1985. He has worked in the worlds of international nonprofits, multimedia and publishing.

1 QuicKeys 3.5.2, street price $100.

2 Tempo II Plus 3.0, street price $115.

3 I am referring to the commercial version of BB Edit 4.0 and not to BB Edit Lite.

*


Return to electric pi

Revised February 16, 1998 lic
Washington Apple Pi
URL: http://www.wap.org/journal/