script to attach folder action scripts to folders

I have about 50 folder actions scripts.
I need to attach them to 50 folders.
Assuming the scripts are in "Library/Scripts/Folder Action Scripts/script1, script2, etc
And the folders are on the top level of the HD. "Macintosh HD/Folder/action1, action2, etc

When done manually all of these work perfectly, it’s basically a prefix attaching drop box factory. What I need is the ability to roll this out on about 40 Macs. So manually attaching the scripts is very time consuming. I had a script in OS 9 that worked perfectly but it didn’t port over to X correctly. All Macs will be running 10.3.7. As always any help would be very much appreciated. Thanks guys.

Jeff

Somebody must have tried to automate folder action script attachment.
No? Anybody.

Any ideas?

Oh well. Go Eagles!!!

http://bbs.applescript.net/viewtopic.php?t=5501&highlight=attach+folder+actions

This guy tried to make it work.
Any Ideas?

Thanks

Jeff

Hi,

This is very easy. I have 2 scripts (Script 1 and Script 2) in my folder action scripts folder and 2 folders on my desktop.

set f1 to “Macintosh HD:Users:kel:Desktop:Folder 1:”
set f2 to “Macintosh HD:Users:kel:Desktop:Folder 2:”
tell application “System Events”
attach action to f1 using “Script 1”
attach action to f2 using “Script 2”
end tell

gl,

This does seem to try to attach the script to the folder, or at least it apears that way if you look at the “Configure Folder Actions” pulldown menu choice when you control click a folder. The little window pops up and the everything looks right, but you can tell something is wrong because for one the script doesnt run, and when you control click on the folder there is no choice to remove a folder action. So the folder really doesnt know a script is attached to it, does that make any sense?

If you go back an attach it manually it shows up differently in the “Configure Folder Actions” pulldown window thing. It shows the folder on the left, and then the first script that was attached via the script and then the second script that was attached manually. The second script shows the extension .scpt the first does not. Also if you highlight the first script and click on the Edit Script button, nothing happens. But if you do the same with the second one, of course it launches.

GRRRRRRRRRR
So close…

tell application “System Events”

attach action to ("Macintosh HD:Users:macuser:testfolder:") using ("Macintosh HD:Library:Scripts:Folder Action Scripts:testscript.scpt")

end tell

This gets the same result, it looks like it works, but it really doesnt.
This is just using relitive paths to try to attach the script to a folder. This is what worked perfectly in OS 9.

GRRRRR again.

Thanks for trying… do you get the same results??

It seems that the folder location is important. I had a suspicion that permissions were somehow to blame for this flakey behaviour. If I put the script in my ( meaning the current users library/scripts/folders action scripts/ location. then the system sees it properly and it works. I need to figure out the correct location for both the folders and the scripts to make this work perfectly. I think I need to run the attach script as the user. I’ll post when I get it fine tuned.

Thanks agian.

the script works here in Jaguar. The configure folder actions option in the contextual menu for the folder must be a Panther thing.

I’m thinking that it’s a Panther bug. I saved my folder action scripts as Compiled Script in case you’re saving it as something else.

gl,

I can confirm that on my Jaguar system, the scripts must be in the user’s “Library:Scripts:Folder Action Scripts:” folder. The ‘attach action to’ parameter must be a complete path string, an alias, or a file specification; the ‘using’ parameter must be either just the script file name (including the extension), an alias, or a file specification.