Errata

AppleScript in a Nutshell

Errata for AppleScript in a Nutshell

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 4
Example 1-1

It should be noted that Example 1-1 works in MacOS classic only; it will
not complie or run uncer MacOS X.

Anonymous   
Printed Page 25

There's a small mistake on Page 25 in 'AppleScript in a nutshell' by Bruce Perry.

It says..

> A common error is to type something like set the Date to "12/5/200",
> which stores a string data type in theDate, not the date value that
> the scripter is aiming for.

This wouldn't set any value at all since the code has a space in the
middle of theDate variable. The correct version should read...

> A common error is to type something like set theDate to "12/5/200",
> which stores a string data type in theDate, not the date value that
> the scripter is aiming for.

That aside, it's an excellent book, very well written. I wish I'd
bought it a long time ago. The O'Reilly web site and participation in
Mac development is really an asset and much appreciated.

Anonymous   
Printed Page 62
first example

It is printed:

set fspec to (new file default name "urfile")

but this lead to a syntax error (both MacOSX and 9.1):

Expected ", " but found class name

Anonymous   
Printed Page 87
Examples for the ^ operator

Applescript in a Nutshell
Page 87

In the section describing the ^ operator; the first Example is incorrect;

set intNum to 10 ^ 2 - - intNum evaluates to 100, an integer

That is wrong . . . from the description for this operator:

Anonymous   
Printed Page 89
The "Description" section of the "begin(s) with" operator

The second sentence in the

Anonymous   
Printed Page 93
No listing for 'div' Operator

There is no listing for the 'div' operator. By functionality it should be grouped
with the 'mod' operator which is described on page 93.

Anonymous   
Printed Page 96
1st line of Sample Code for Ivalue typen.

I ran the following script in Script Editor v1.7 and the value of
the variable intNum si.

Set intNum to 10 ^ 2
Log class of intNum
iD section contains an error. It reads; splay dialog equal to 100.0 and
itdex reference form.;

Tell is mispelled as telll

Anonymous   
Printed Page 136
7th line of Sample Code for if simple statement

The Code reads:

if (current date) 3 date "Saturday, January 1, 2000 12:00:00 AM"
then --compound if statement

The '3' should be a greater than sign '>'

Anonymous   
Printed Page 155
Bottom half of page

Ioperand to the left contains the operand to the right, then the
expression returns true .

The sentence should read; cannot build a subroutine with a "do menu
menu item..." action. A Syntax Error "Expected end of line, etc., but
found identifier" alert is generated. Iright, then the expression
returns true .

The phrase am guessing that a "do menu menu item ..." action is some
sort of subroutine in itself. The only guidance I can find is on page 155,
where the reader is cautioned "However, you cannot define another subroutine
inside of a subroutine definition." I guess that is (mayb)e could be
replaced with what I am trying to do. The following script will produce
the alert. I have also included my workaround (learned from your
excellent book)"

Alert will be generated:

with timeout of 10000 seconds

tell application "FileMaker Pro"

changefont()

end tell


end timeout

on changefont()

do menu menu item "Helvetica" of ?
menu "Font" of menu "Format"

do menu menu item "12 PointintNum

" of ?
menu "Size" of menu "Format"

end changefont

The following script is my workaround:

with timeout of 10000 seconds

repeat 723 times

tell application "FileMaker Pro"

do menu menu item "FirstField" of ?
menu "Scripts"

repeat 59 times

do menu menu item "Helvetica" of ?
menu "Font" of menu "Format"

do menu menu item "12 Point" of ?
menu "Size" of menu "Format"

do menu menu item "NextField" of ?
menu "Scripts"

end repeat

do menu menu item "GoNextRecord" of ?
menu "Scripts"

end tell



end repeat


end timeout

Anonymous   
Printed Page 165
Second paragraph

The first parentheses in the second sentence of the paragraph is
misplaced; it should appear immediately before the word

Anonymous   
Printed Page 415
bottom of the page

Example 33-3 does not work in OS X 10.2

Anonymous   
Printed Page 422
4th paragraph = second example

The second example on p422 is of a script whic h, not before the
word purportedly displays a dialog box.

I cannot get osacs.

The sentence should read: ript to execute a script that creates a
dialog box in OS X 10.1. The group of methods defined together as
a library, (which is discussed in the sectionO), or a bunch of
properties, methods, and stta in the sentence, but ements that
cmo is incorrect.

prise a
single objectS.
reports:

execution error: Finder got an error: No user interaction allowed.
(-1713)

You *can* activate the Finder to bring it to the front (as in the
example on p422), but you still get this error. So, it looks as if
Apple has code blindly checking and blocking scripts issued by osa-
script which attempt to interact with the user. Elsewhere I got an
error "explaining" that this is due to osascript executing in the background.

Anonymous