: Thanks, but this time the error changes to: Error -1700 Finder
: got an error: Can’t make folder “Jack’s Hard Disk”
: into an item.
: Should I change it to: set FolderList to list folder folder
: (TheDisk as string)
: This errors only comes in 9.2.2. Can anything wrong with the name
: “Jack’s Hard Disk” ?
Hmmm. The script you posted doesn’t work on either of my machines. One of these is running Mac OS 8.6 (AppleScript 1.3.7), the other has Mac OS 9.2.1 (AS 1.6). The cure I posted - putting the word ‘folder’ (or the word ‘disk’) before the disk name - works on both machines. Other combinations that work within the Finder tell block are the rather long-winded:
set FolderList to list folder alias (disk TheDisk as string)
set FolderList to list folder (disk TheDisk as string)
set FolderList to list folder alias (TheDisk & ":")
If your script’s working on your own machine, it may mean that you have Jon’s Commands or Akua Sweets installed. These silently coerce path strings (which, strictly speaking, TheDisk isn’t - it’s just a name) to file specifications when the occasion demands. If that’s the reason it works for you, then it won’t work for your friend if he doesn’t have those OSAXen. Basically, ‘list folder’ requires a file specification, a Finder reference, an alias, or a path string. “Jack’s Hard Disk” is a perfectly good name, but it isn’t one of these four things. It’s just a name. A colon on the end would turn it into a path string for a volume.
That said, there are known to be several problems with AS 1.7, which comes with OS 9.2.2. There was an explanation on the MACSCRPT mailing list this morning (my time) from Chris Espinosa of Apple, concerning ‘list folder’. Apparently, the AS 1.7 version can’t accept path strings. The input has to be one of the other three types. This may have been fixed in AS 1.8.2b1. If not, it would be in the next Beta version.
I don’t know if you actually require the disk names for your purposes, but an easier way to get to what your excerpt does is:
tell application "Finder"
repeat with TheDisk in (disks where it is local volume and it is not ejectable)
set FolderList to list folder TheDisk
end repeat
end tell
NG