scripting "Folder Actions Setup"

I’ve noticed that the “Folder Actions Setup” utility is now itself scriptable, but I’m not very good at AppleScript yet. Can somebody help me figure out how to create a script that will enable folder actions on the machine (if they’re not already), and assign a particular action to a particular folder?

Thanks a lot!