Re: Folder Actions Shortcomings...
Re: Folder Actions Shortcomings...
- Subject: Re: Folder Actions Shortcomings...
- From: Chris Nebel <email@hidden>
- Date: Sun, 08 Apr 2001 14:16:14 -0700
- Organization: Apple Computer, Inc.
Hellum Timothy wrote:
>
It has been suggested to me that Folder Actions Plus is "hard" on the
>
system, but I was not in a position to inquire further into this "hardness."
>
Anyone have any ideas? And anyone know why scripts will not trigger except
>
when items are dragged into/out of folders? This seems so limiting!
The basic problem is that Mac OS has no efficient way for a program to say
"tell me when this arbitrary file/folder changes." (To be fair, very few
operating systems do -- it's tough to do without penalizing file system
performance tremendously.) Folder Actions Plus gets around this by checking
every actioned folder every few seconds and asking "have you changed?" If
you've got a lot of actioned folders, or if some of them are actually on a
network, this can seriously affect the performance of the rest of the system.
Mac OS 9 solves the problem a different way: because the Finder is already
aware of changes in any folder you've got an open window for, it's very little
additional cost for it to trigger an action. Of course, this means that
actions don't work on closed folders, but on the other hand, it won't bog down
your system. You might well ask: "Why doesn't the Finder know about things I
drop on a closed folder?" Well, it does, but that's not the real problem. The
thing that makes folder actions hard is that you aren't the only person who can
change a folder: an application could put something in there (e.g. a download
or log file), or -- and this is the really hairy one -- the folder could be
shared over the network, and another user could put something in there. (A
small tip, by the way: pop-up folders are considered to be open windows. If
you need an actioned drop folder, make it a pop-up window -- then it's small
and unobtrusive but easily available, and an "on added items" action will still
work.)
Naturally, we'd like to provide the best of both worlds, but the necessary
underpinnings aren't there, and what shape they might take is still under
debate.
--Chris Nebel
AppleScript Engineering