Unlocking redux
Unlocking redux
- Subject: Unlocking redux
- From: John Cooper <email@hidden>
- Date: Mon, 27 Aug 2001 13:12:58 -0700
I'm having a problem where certain files I put into the trash don't
disappear using option-Empty Trash. In fact, an alert asking me to
choose between stopping and continuing appears, as though I hadn't
been holding the Option key down when I chose Empty Trash from the
Special menu. (The option key does work; I use it for other purposes
successfully.) The problem has persisted through the recreation of
Finder preferences, rebuilding the desktop, and even through the
upgrade from Mac OS 9.1 to OS 9.2.1.
So I tried using a couple of scripts previously posted to this list.
Both give me error messages I don't understand. The first script is
this:
tell application "Finder"
set x to items of trash as alias list
end tell
deleteFile x with unlocking without safety net
...and it give the error "File disk:Trash:filename is locked" (where
'disk' and 'filename' are placeholders).
The second script begins with these two lines:
set fileList to files of trash as list
set folderList to folders of trash as list
..which gives the syntax error "Can't get folders of trash. Access
not allowed."
If I comment out that line and the sequence which depends on
folderList, that leaves:
set fileList to files of trash as list
my UnlockFiles(fileList, folderList)
on UnlockFiles(fileList, folderList)
tell application "Finder"
repeat with fileItem in every item of fileList
set locked of fileItem to false
end repeat
end tell
end UnlockFiles
... and this chokes on the very first line, with error "Can't get
every file of trash."
Well, why the heck not? If you can help diagnose this, I'd sure
appreciate it. Meanwhile, I reboot into OS X, drag the files from the
OS 9 Trash into the OS X Trash, and delete them there. What a pain!
--
John Cooper