Last updated: 99.05.24
Background
ExplanationAppleWorks 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.
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 areaContainers
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.Events
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.
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.Inheritance
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.
A class inherits its support for properties and events from a single parent class.document
Plural Form
documentsContainer
applicationElements
window by numeric index, by name, as a range of elements, satisfying a testProperties
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
.window
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 documents name
Plural Form
windowsContainer
application, documentElements
splitby numeric index, as a range of elements, satisfying a test
.text
property class OK
description name international text [r/o] R
the windows 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
Elements
text as a range of elementsProperties
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
.Events
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 characters 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
deleteSub classes
freezes or crashes the computer often when a second delete is sent
if last test in document, text deletes but still shown in window.
character, footer, header, footnote, paragraph, section, wordInheritance
itemparagraph
Plural Form
paragraphsContainer
text bodyElements
character by numeric index, as a range of elementsProperties
footnote by numeric index
tab stop by numeric index
text as a range of elements
.Inheritance
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
textword
Plural Form
wordsContainer
paragraph
character by numeric index, as a range of elementsProperties
text as a range of elements
.Inheritance
property class OK
description index integer NAP
the index of the word in the text
textcharacter
Plural Form
charactersElements
character by numeric index, as a range of elementsProperties
text as a range of elements
.Inheritance
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 characters 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".
textheader
Plural Form
headersContainer
documentProperties
.Inheritance
property class OK
description orientation left pages/ right pages/ all pages
Accessing text properties of a header will crash the computer.
textuser style
Plural Form
user stylesElements
style attribute by numeric indexProperties
.database
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
Plural Form
databasesElements
layout by name, by numeric indexSub classes
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
style attributeProperties
.Inheritance
property class OK
description current record integer CS
is the record visible?
itemrecord
Reference
record <index>Plural Form
recordsElements
field by name, by numeric indexProperties
.Inheritance
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 1This works:
set myRecord to record 1
<property> of myRecord
itemfield
Reference
|<field name>| of myRecordPlural Form
This fails:
field <fieldname> of myRecordThis works:
|<fieldname>| of myRecordCan read but not write.
fieldsProperties
.graphic object
property class OK
description name string [r/o]
the name of the field index integer [r/o]
the index of the field
Plural Form
graphic objectsSub classes
rectangle, oval, arc, line, polygon, rounded rectangle, group, picture, spreadsheet frame, text frame, paint frame, chart legend, movie.Containers
drawing areaProperties
.Events
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 objects appearance
count: failsInheritance
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}}move
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.
failsselect
itemline
Plural Form
linesContainer
drawing areaProperties
.Inheritance
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
graphic objectarc
Plural Form
arcsContainer
drawing areaProperties
.Inheritance
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
graphic objectpolygon
Plural Form
polygonsContainer
drawing areaElements
vertex - by numeric index. References to any property of a vertex fail.Inheritance
graphic objecttext frame
Plural Form
text framesContainer
drawing areaProperties
.Inheritance
property class OK
description text body text [r/o] Y
the objects text
graphic objectmovie
Plural Form
moviesContainer
drawing areaProperties
.Events
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?
graphic objectcell
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".Plural Form
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)"
cellsContainer
spreadsheetElements
cell by numeric index, as a range of elementsProperties
row by numeric index, as a range of elements
column by numeric index, as a range of elements
.Events
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 cells 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 cells appearance
Inheritance
item
Return to Parent Folder