Did you paste it into the Aliases section or the Remote section in the Scripts dialog?

This type of script needs to be pasted into the Remote section.