Attaching a folder script

I ca not for the life of me figure out why this script is not working. Can anyone help me out?

tell application “System Events”
set folder actions enabled to true
make new folder action at end of folder actions with properties {enabled:true, name:“Downloads”, path:“/Users/rmauzy/Downloads”}
tell folder action “Downloads” to make new script at scripts with properties {name:“/Library/Scripts/Folder Action Scripts/add - open in MerrillToolX.scpt”}
end tell

Thank you

Browser: Safari 605.1.15
Operating System: macOS 10.14

You have syntax of make new script wrong. Clause at scripts should be at end of scripts. And, you should provide script’s Posix path instead of the name. Here is full example:


set targetFolder to choose folder with prompt "Choose folder you want make Hot folder"
set targetFolderPath to POSIX path of targetFolder

set folderActionScript to ¬
	choose file of type "com.apple.applescript.script" default location ¬
		(((path to library folder from user domain) as text) & ¬
			"Scripts:") as alias
set folderActionScriptPath to POSIX path of folderActionScript

tell application "System Events"
	set folder actions enabled to true
	set folderName to name of targetFolder
	if not (exists folder action folderName) then set folderAction to make new folder action at ¬
		end of every folder action with properties {name:folderName, path:targetFolderPath}
	make new script at end of scripts of folderAction ¬
		with properties {POSIX path:folderActionScriptPath}
end tell