AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Second Edition

Hanaan Rosenthal

Errata for 1-59059-653-6

Page

Errata

Correction

40

Finder example for startup disk does not work.  Error I get:Finder got an error: Can't get name of every file of startup disk of startup disk.

The problem is referring to the startup disk object twice.

What the script understand from this is that:

 

name of files of startup disk of startup disk of application "Finder"

 

to fix it, remove either reference to the startup disk.

Either like this:

 

tell application "Finder"

set nameList to name of files of startup disk

end tell

 

or like this:

 

tell application "Finder"

tell startup disk

set nameList to name of files

end tell

end tell