Re: Attaching Folder Action
Re: Attaching Folder Action
- Subject: Re: Attaching Folder Action
- From: email@hidden (Michael Sullivan)
- Date: Tue, 30 Jul 2002 12:45:25 -0400
- Organization: Society for the Incurably Pompous
>
Hi,
>
I'm looking for a way to attach a folder action script
>
to a folder using some kind of API (on OS 9), and not
>
through the 'Attach Folder Action' menu obtained with
>
the control-click.
>
I would like my application to be able to
>
automatically attach a script to a folder when the
>
user chooses his 'hot folder', and not to make him
>
attach it manually.
>
Anyone knows how this can be done?
I'm pretty sure you can't do it. The technique to use is to prepare a
script that runs an idle loop and checks the folder every few seconds or
so for new items. This won't work for things like responding to changes
in view and such, but it's fine for the typical "hot folder"
application.
In any case, once you've got this script, make it an always on app, and
store the path to the folder in a property. You can set the property
from an outside application by sending apple events. Just do something
like:
tell application "Your script"
launch
set watchedFolder to alias "path:to:watched:folder:"
end tell
If you also move the script in question to the startup items folder when
you activate, you're home free.
Michael
_______________________________________________
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.