Re: Folder actions
Re: Folder actions
- Subject: Re: Folder actions
- From: "Bob.Kalbaugh" <email@hidden>
- Date: Fri, 07 Sep 2001 00:54:41 -0500
on 8/24/01 4:38 PM, Reno Tomasi at email@hidden wrote:
>
Is there a way to attach a folder action using a script?
on 8/27/01 11:41 AM, Reno Tomasi at email@hidden wrote:
>
I am trying to use a script to attach a "Folder Action" to a folder. I am
>
not having any luck.
>
>
Thanks,
>
Reno
Hi Reno,
I'm not sure if anyone responded off-list, but it appears that nobody did so
on-list. Well, Mr. Bill Cheeseman did reply to the first post.
If you haven't already figured it out for yourself, then check out the AS
dictionary for "Folder Actions". (It's in the extensions folder.) It
contains all the syntax that I believe you are looking for. I just happened
upon it today and recalling your post, decided to reply.
For experimenting purposes, I've been playing around with the following
script. Mind you that I've set it up real quick and the (choose from list,
choose folder) commands have not been trapped for cancel.
--
set actionPath to (path to Folder Action scripts)
set actionList to (list folder actionPath)
choose from list actionList with prompt "Attach what action?"
set theAction to (actionPath & the result) as text
choose folder with prompt "Attach an action to what folder?"
set theFolder to the result as text
tell application "Folder Actions"
attach action to alias theFolder using alias theAction
end tell
tell application "Finder"
update alias theFolder
end tell
--
Hope that helps,
--
bob.kalbaugh