Pass the contents of pbpaste into a script

I am just starting to experiment with Wolfram Script. I have the following script:

#!/usr/bin/env wolframscript -function -args
Function[StringReplace[#, "\n" -> ", "]]

./print.wls "hello 
 world"

Produces “hello, world” so the function works as expected. I now want to run it where the input comes directly from the text added to the clipboard.

I tried

pbpaste | ./print.wls 

But the WLS throws an error

Function::slotn: Slot number 1 in StringReplace[#1,  -> , ] &  cannot be filled from (StringReplace[#1,  -> , ] & )[].

Can someone enlighten me as to the correct approach?

Cheers
Andy