RE: Applescript differences between OS 8 and 9...
RE: Applescript differences between OS 8 and 9...
- Subject: RE: Applescript differences between OS 8 and 9...
- From: Nigel Garvey <email@hidden>
- Date: Wed, 29 Nov 2000 14:48:09 +0000
Hellum Timothy wrote on Tue, 28 Nov 2000 21:07:28 -0500:
>
Well Bill,
>
>
The code was posted today at about 3 pm, but it goes as follows:
>
>
on open (theList)
>
tell application "Finder"
>
repeat with theItem in theList
>
if class of theItem is file then
>
set locked of theItem to false
>
end if
>
set fileName to name of theItem
>
set fileType to file type of theItem
>
set creator type of theItem to "8BIM"
>
end repeat
>
end tell
>
end open
>
>
Thank you for any insights...
The class of 'theItem' (with OS 8.6 at least) is 'alias', not 'file', so
the instruction in the 'if' loop is never carried out. (Also, getting the
name and file type of each file is a waste of time here as you don't use
them. However, perhaps this is an excerpt from a larger script?)
What does work with OS 8.6, and is probably faster, is:
on open (theList)
tell application "Finder"
select theList
tell every file of the selection
if (count) > 0 then set {locked, creator type} to {false, "8BIM"}
end tell
end tell
end open
NG