Re: attach folder action to trash
Re: attach folder action to trash
- Subject: Re: attach folder action to trash
- From: Richard 23 <email@hidden>
- Date: Tue, 14 Nov 2000 00:01:58 -0800
>
>Well, first of all, you would have to leave the trash window open all the
>
>time so that the folder action would work. But it is my understanding that
>
>you can't attach a folder action to the trash.
>
>
The desktop trashcan icon doesn't represent a real folder...it represents
>
the union of the Trash folders of all the mounted volumes (even if "all the
>
mounted volumes" is one volume). Since the icon doesn't represent a real
>
folder, it would not surprise me to learn that one can't attach folder
>
actions to it.
>
>
You *might* succeed by making all the trash folders visible, opening them,
>
and attaching folder actions to each. On the other hand, you might find
>
the result visually "mildly annoying."
Here's an idea:
tell application "Finder"
set fakeName to "Trash" & (ASCII character 2)
set bounds of trash to {961, 715, 0, 0}
delete folder fakeName
if not (exists folder fakeName in desktop) then
set theBounds to position of trash & {0, 0}
make folder at desktop with properties {bounds:{-100, -100, 0,
0}, name:fakeName}
set fakeTrash to result as alias
end if
set theIcon to icon of trash
set icon of fakeTrash to theIcon
set bounds of fakeTrash to theBounds
set bounds of trash to {-100, -100, 0, 0}
end tell
NOTE: the bounds buisness is only necessary in Mac OS 9 to get around the
snap to grid/positioning quagmire. Earlier systems can use position.
Just the start of an idea. You may not be able to attach a folder action
to the trash but you could to a decoy such as this. If you have multiple
volumes, you'll have to have separate folders for each and route
accordingly.
Making copies of the full and empty icons where your script can get at
them
is a good idea...better than trying to extract them every time.
Setup would be at startup time using the Startup Items folder.
Might be a good idea to use the comment field for the put away location
since only the real trash can do that.
R23