Re: Newbie question - listing items in the trash
Re: Newbie question - listing items in the trash
- Subject: Re: Newbie question - listing items in the trash
- From: Christopher Nebel <email@hidden>
- Date: Tue, 19 Mar 2002 13:38:14 -0800
On Tuesday, March 19, 2002, at 08:35 AM, Waters, Nigel wrote:
I have written a script in Mac OS 8.6 that used the following commands
to
list items in the trash folder:
tell application "Finder"
set trash_list to list folder trash
end tell
When I use it in OS 9.2.2, I receive the following error in the event
log:
tell application "Finder"
list folder trash
--> Finder got an error: Can't make trash into a item.
This is a known bug in AppleScript 1.7, and should be fixed in the
current 1.8.2b3 seed. Using Finder object specifiers with scripting
addition calls like this is a little-known and undocumented but
often-used feature. (Typically, it's used somewhat accidentally by
newbies like yourself -- more experienced folk "know" it shouldn't work
and don't try it. I should point out that it doesn't work on Mac OS X
yet because of a problem in the Finder itself.)
To fix the problem, either install the AppleScript seed, or change your
script to this:
set trash_list to list folder (path to trash) -- no tell block
required
or this:
tell application "Finder"
set trash_list to the name of every item of the trash
end
--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.