Re: how to set folder action
Re: how to set folder action
- Subject: Re: how to set folder action
- From: Webmaster <email@hidden>
- Date: Sun, 23 Dec 2001 18:06:12 -0800
Thanks- that did the trick- almost.
you are right about the cryptic errors. I get a -1728 error and the script
won't execute a second time unless you acknowledge the error.
Jim
on 12/23/01 5:31 PM, a day like any other, Mr Tea at email@hidden wrote:
>
This from Webmaster at @077 on Sun, Dec 23, 2001
>
>
>
> How do I tell the script to run whenever a file is added to the folder?
>
>
Wrap it in this...
>
>
on adding folder items to theFolder after receiving theItems
>
--your script here
>
end adding folder items to
>
>
..then control click on the folder you want to attach the script to,
>
select the 'attach folder action' option, and navigate to your script in
>
the resulting 'open' dialog. (Folder Actions will then place an invisible
>
alias to the script in that folder.) The script snippet above contains
>
two variables: theFolder - a reference to the folder the action is
>
attached to; and theItems - which can refer to either a single item saved
>
or dragged into the folder, or a list of items when multiple files/
>
folders are dragged.
>
>
Some caveats:
>
>
The folder must be open (but can be collapsed to a pop-up tab) for the
>
action to work.
>
>
Folder action error messages are notoriously indecipherable, giving
>
oblique numerical error references instead of plain info. I think you can
>
find a key to what these numbers mean in the AppleScript Language Guide,
>
but you may want to put in an error handler that displays a more
>
immediately useful dialog, at least during the testing stage...
>
>
HTH (& MC & HNY)
>
>
Mr Tea