Last updated: 99.05.24

Background

AppleWorks has a rich AppleScript dictionary. Unfortunately, much of that dictionary just doesn't work when accessed from a script. It seems to be that the AppleScript support in AppleWorks was started but not completed.

The syntax below is focussed around the AppleScript dictionary of AppleWorks, which you can see by dropping the AppleWorks application onto Script Editor. As we discover problems with each event, object or property, they are documented here. General holes in AppleWorks' AppleScript support appear on our holes page.


Explanation
Plural Form
The plural form of an object may always be referenced as "every <class>". But it may also be referred to by its plural form. This is usually just the singular form with an "s" added, but some words require special plural forms, such as axis -> axes, vertex -> vertices.
Elements
The elements of an object class are those other classes which can be contained by it. For example, a graphic object is an element of a drawing area
Containers
The containers of a object class are those other classes which can contain it. For example, a drawing area can contain a graphic object.
Properties
A property is an attribute of the class. AppleScript can get the value of a property and, unless that property is read only, set it to another value. The value of a particular property may be one of a variety of classes, such as integer, text, record, or a special data structure such as a bounding rectangle consisting of a list of four integers.

The properties of a class appear here in a table, showing property, class (of that property), OK, and description. The OK column shows whether that property actually works for that class. Ideally, all should work, but AppleWorks has a few bugs.

The following codes are used in OK column to indicate the type of error encountered when attempting use of that property.
Y - yes, this one works as expected.
R - read tested OK. Write not tested or not applicable.
RW - read and write (get and set) both specifically tested OK.
NAP - not a property of the specified class
CG - can't get
NE - no effect when property is set
WD - weird data structure returned when getting property.
WI - write (ie set value) allowed but ignored.
CS - can't set. Can get OK.
Events
The application has a suite of events, listed separately in the dictionary from the class list. However, each event only works with a subset of the classes. For instance, AppleScript can close a window, but not a word. So, each class listed here also lists the events which it supports. Some, which it should support but don't, are listed with the failure or the peculiar requirements.
Sub classes
Sub classes share the same support for properties and events as their parent class, while having more specific ones of their own. Sub classes exist in the same level as their parent in the hierarchy of elements and containers.

For example, an arc is a sub class of graphic object. So it supports the same properties of bounds and rotation and the same events of make and delete. But it also has its own additional properties such as start angle. A graphic object is contained by a drawing area, so is an arc.
Inheritance
A class inherits its support for properties and events from a single parent class.


document
Plural Form
documents
Container
application
Elements
window by numeric index, by name, as a range of elements, satisfying a test
page by numeric index, as a range of elements, satisfying a test
header
footer
pattern by numeric index
texture by numeric index
gradient by numeric index

Properties
.
property class

OK

description
text body text [r/o]

R

.
drawing area drawing area [r/o]

R

.
painting painting [r/o]

.

.
spreadsheet spreadsheet [r/o]

R

.
database database [r/o]

R

.
connection connection

.

.
terminal terminal

.

.
file transfer file transfer

.

.
stylesheet stylesheet [r/o]

.

.
preferences document preferences

.

.
modified boolean

RW

has the document been modified since the last save?
page setup print record

RW

.
margins rectangle

RW

.
name international text [r/o]

R

.
index integer [r/o]

R

.
document kind DR/WP/SS/DB/PT/CM [r/o]

R

.
file alias [r/o]

R

fails if document opened read only.
title plain text

CG

.
author plain text

CG

.
version plain text

CG

.
keywords plain text

CG

.
category plain text

CG

.
description plain text

CG

.

property class

OK

description
selection selection object

R

the current user selection or insertion point
merge file alias

RW

the database file with which to merge
merge record small integer

RW

the record index of the database record currently being merged
merge boolean

RW

is merge field data currently being shown?
autohyphenate boolean

RW

automatically hyphenate as you edit and type new text?
date format numeric date/short abbreviated date/short date/long abbreviated date/long date

CG

format to use when displaying dates
fractional character widths boolean

CG

use fractional character widths when drawing text?
smart quotes boolean

CG

use smart quotes?
side handles boolean

CG

use side handles (for a total of 8) when displaying object selection?
polygon autoclose boolean

CG

automatically close polygons?
show invisibles boolean

CG

show invisible characters in text?
color palette size 256 colors/ 81 colors

CG

type of palette to use to display color choices
autosmooth boolean

CG

automatically smooth freehand?
gradient drawing faster/better

CG

method to use for displaying gradients
shift constraint integer

CG

the angle at which the shift key constrains the mouse
character delay integer

CG

the number of 60ths of a second to delay per character when pasting text to a connection
line delay integer

CG

the number of 60ths of a second to delay per line when pasting text to a connection
save screen boolean

CG

save the screen to the scrollback before clearing?
capture type port/screen

CG

location from which to capture text
scrollback limit boolean

CG

limit the scrollback to a maximum size?
scrollback maximum integer

CG

maximum size of the scrollback (units are specified by scrollback type)
scrollback type lines/bytes/screens

CG

units for the maximum scrollback size
open option open connection/wait for connection/do nothing

CG

action to perform when opening the communications document
transfer folder alias

CG

the default folder for received files
name international text [r/o]

R

the document’s name



window
Plural Form
windows
Container
application, document
Elements
split by numeric index, as a range of elements, satisfying a test
pane by numeric index, as a range of elements, satisfying a test
'cBln' by numeric index

Properties
.
property class

OK

description
name international text [r/o]

R

the window’s name
document document [r/o]

R

the document associated with the window
bounds bounding rectangle

RW

the boundary rectangle for the window
zoomed boolean

RW

Is the window zoomed?
position point

RW

upper left coordinates of the window
scale real

RW

the viewing scale (zoom percentage)
ruler ruler

NAP

the ruler for this window
tools boolean

R

is the tool panel for this window visible? Error: write does opposite.
page view boolean

CS

is the window in page view?
database view browse view/find view/layout view/list view

RW

(for databases only) the view type for the database



text
Elements
text as a range of elements
character by numeric index, as a range of elements
footnote by numeric index, as a range of elements
section by numeric index, as a range of elements
paragraph by numeric index, as a range of elements
word by numeric index, as a range of elements
Properties
.
property class

OK

description
font text

Y

the name of the font of the first character
style text style info

WI

the text style of the first character
user style record

Y

the user style (and incremental attributes) defining the first character’s appearance
size real

Y

the size in points of the first character
writing code writing code [r/o]

NAP

the script system and language of the first character
uniform styles text style info [r/o]

Y

the text styles which are uniform throughout the specified text
length integer [r/o]

Y

length of the text
offset integer [r/o]

Y

offset of the text from the beginning of the enclosing text object

Events
delete
freezes or crashes the computer often when a second delete is sent
if last test in document, text deletes but still shown in window.
Sub classes
character, footer, header, footnote, paragraph, section, word
Inheritance
item


paragraph
Plural Form
paragraphs
Container
text body
Elements
character by numeric index, as a range of elements
footnote by numeric index
tab stop by numeric index
text as a range of elements

Properties
.
property class

OK

description
index integer [r/o]

the index of this paragraph in the text
level integer

NAP

the outline level
left indent ruler measurement info

NAP

the left indentation
right indent ruler measurement info

NAP

the right indentation
first line indent ruler measurement info

NAP

the initial indentation of the first line
line spacing ruler measurement info

NAP

the space between the lines of a paragraph
space before ruler measurement info

NAP

the space before a paragraph
space after ruler measurement info

NAP

the space after a paragraph
label none/ diamond label/ bullet label/ checkbox label/ Harvard label/ leader label/ legal label/ letter label/letter caps label/ numeric label/Roman label/ Roman caps label

NAP

the outlining label type associated with a paragraph
justification left/ right/ center/ full

NAP

Justification of the text

Inheritance
text


word
Plural Form
words
Container
paragraph
text body
Elements
character by numeric index, as a range of elements
text as a range of elements
Properties
.
property class

OK

description
index integer

NAP

the index of the word in the text

Inheritance
text


character
Plural Form
characters
Elements
character by numeric index, as a range of elements
text as a range of elements
Properties
.
property class

OK

description
color RGB color

Y

the color
merge field boolean [r/o]

Y

is this characters a merge field placeholder?
merge field name string

the name of the database field to be merged at this point in the text
merge field data string [r/o]

the contents of the database field to be merged at this point in the text for the current record; undefined if not merging
drawing area drawing area [r/o]

NAP

the character’s drawing area (only for embedded graphics)

Note: font, size, writing code, style, uniform styles, user style are also in the dictionary, but not listed here since they are also properties of the parent class "text".
Inheritance
text


header
Plural Form
headers
Container
document
Properties
.
property class

OK

description
orientation left pages/ right pages/ all pages


Accessing text properties of a header will crash the computer.
Inheritance
text


user style
Plural Form
user styles
Elements
style attribute by numeric index
Properties
.
property class

OK

description
name string

Y

the name of the user style
style type basic style/ paragraph style/ outline style/ table style [r/o]

Y

the style type
base style user style

Y

the user style this one is based on
incremental styles list of style attribute

Y

attributes applied to an object in addition to the user style

name is incorrectly "Untitled xx" rather than the actual name of the style.

This fails:
<property> of user style of...
This works:
set myStyle to user style of...
<property> of myStyle



database
Plural Form
databases
Elements
layout by name, by numeric index
field by name, by numeric index
record by numeric index, as a range of elements, satisfying a test
report by name, by numeric index
db search by name, by numeric index
db sort by name, by numeric index
request by numeric index, as a range of elements
Sub classes
style attribute
Properties
.
property class

OK

description
current record integer

CS

is the record visible?

Inheritance
item


record
Reference
record <index>
Plural Form
records
Elements
field by name, by numeric index
Properties
.
property class

OK

description
visible boolean [r/o]

NAP

is the record visible?
index integer [r/o]

NAP

the record number
id small integer [r/o]

Y

the record id
creation date date [r/o]

Y

the date/time the record was created
modification date date [r/o]

Y

the date/time the record was last modified

This fails:
<property> of record 1
This works:
set myRecord to record 1
<property> of myRecord
Inheritance
item


field
Reference
|<field name>| of myRecord

This fails:
field <fieldname> of myRecord
This works:
|<fieldname>| of myRecord

Can read but not write.

Plural Form
fields
Properties
.
property class

OK

description
name string [r/o]

the name of the field
index integer [r/o]

the index of the field


graphic object
Plural Form
graphic objects
Sub classes
rectangle, oval, arc, line, polygon, rounded rectangle, group, picture, spreadsheet frame, text frame, paint frame, chart legend, movie.
Containers
drawing area
Properties
.
property class

OK

description
bounds bounding rectangle

Y

the smallest rectangle that contains the entire graphic object
fill color RGB color

CG

the fill color
fill pattern integer

CG

the fill pattern
fill gradient integer

CG

the fill gradient
fill texture integer

CG

the fill texture
pen color RGB color

Y

the pen color
pen pattern integer

CG

the pen pattern
pen width real

Y

the pen width
rotation integer

Y

the rotation of this object in degrees from horizontal
definition rectangle bounding rectangle

CG

the rectangle used to define the object; this is usually the same as the bounds except when the object is rotated
text wrap no wrap/ regular wrap/ irregular wrap

NE WD

the way in which text should wrap around an object
wrap gutter ruler measurement info

WD

the amount of space to allow between an object and the text wrapping around it
lock read only/read write

CG

indicates whether or not the object may be moved, deleted, or modified
user style record

NAP

the user style (and incremental attributes) defining the object’s appearance


Events
count: fails
delete
duplicate: fails
exists: returns true if exists but returns error if doesn't exist
make
at front with properties{bounds:{x1,y1,x2,y2}}
defaults to rectangle unless sub class (eg oval, line etc) used instead of "graphic object".
works for new line, oval.
Fails for new spreadsheet frame, text frame. Makes a rectangle
Must specify properties with at least one label and value, but only bounds will actually work.
Accepts at front, at end or at back, but still makes at front.
move
fails
select

Inheritance
item


line
Plural Form
lines
Container
drawing area
Properties
.
property class

OK

description
end point point

RW

the ending point of the line
arrow style no arrow/ arrow at start/ arrow at end/ arrow at both ends

Y

the arrow style
start point point

RW

the starting point of the line

Inheritance
graphic object


arc
Plural Form
arcs
Container
drawing area
Properties
.
property class

OK

description
arc angle small integer

Y

Angle of the arc in degrees
start angle small integer

Y

the angle that defines the start of the arc, in degrees

Inheritance
graphic object


polygon
Plural Form
polygons
Container
drawing area
Elements
vertex - by numeric index. References to any property of a vertex fail.
Inheritance
graphic object


text frame
Plural Form
text frames
Container
drawing area
Properties
.
property class

OK

description
text body text [r/o]

Y

the object’s text

Inheritance
graphic object


movie
Plural Form
movies
Container
drawing area
Properties
.
property class

OK

description
original bounds bounding rectangle

CG

the rectangle that bounds the object at normal size
loop none/ forward/ back and forth

CG

how the movie should loop while playing
playing boolean [r/o]

CG

is the movie currently playing?
rate real

CG

the rate at which the movie plays
direction forward/ backward

CG

the direction the movie plays
duration real [r/o]

CG

the duration of the movie (at a rate of 1.0)
current time real

CG

the current time position within the movie
volume real

CG

the sound volume of the movie when playing
modified boolean

CG

has the movie been modified since the document was last saved?

Events

Inheritance
graphic object



cell
There appears to be a bug when using "cell". When asked for cell 1, there is no problem. But a request for cell 2 will return cells 2 and 3. A request for cell 3 will return cells 3, 4 and 5. To work around this bug, just prefix these references with "cell 1 in", such as "cell 1 in cell 3 in...". Or reference cells by alpha numeric grid, eg cell "A1".

Cannot set the formula of a cell, but can set the cell itself to be the formula (ie set cell "A3" to "=A1+A2"). If the formula contains a reference to a cell past the Z column, AppleWorks will crash. eg "=SUM(AA45..AA55)"

Plural Form
cells
Container
spreadsheet
Elements
cell by numeric index, as a range of elements
row by numeric index, as a range of elements
column by numeric index, as a range of elements
Properties
.
property class

OK

description
formula text

CS

the formula of the cell
format general/ currency/ percent/ scientific notation/ fixed/ numeric date/ short abbreviated date/ short date/ long abbreviated date/ long date/ short time/ long time/ short military time/ long military time

Y

the cell format
lock read only/ read write

Y

Indicates whether value or formula in the cell can be changed
name plain text

Y

the name of the cell (e.g., "A1")
color RGB color

Y

the cell’s text color
font text

Y

the name of the font of the cell
size real

Y

the size in points of the cell text
writing code writing code [r/o]

Y

the script system and language of the cell text
style text style info

Y

the text style of the cell
fill color RGB color

Y

the fill color
fill pattern integer

Y

the fill pattern
alignment general/ left/ right/ center

Y

justification of the text
decimal places integer

Y

digits of precision
commas boolean

Y

display numbers with thousands separators?
parentheses boolean

Y

display negative numbers in parentheses?
wrap boolean

Y

wrap text within a cell?
left border boolean

Y

draw a border on the left side of the cell?
top border boolean

Y

draw a border on the top of the cell?
right border boolean

Y

draw a border on the right side of the cell?
bottom border boolean

Y

draw a border on the bottom of the cell?
outline border boolean

NAP

draw a border framing the range of cells?
user style record

NAP

the user style (and incremental attributes) defining the cell’s appearance

Events

Inheritance
item




Return to Parent Folder