Mark - I eventually figured out the problem. It was the form of the quotes - this CMS must convert quotes to stylised quotes, when they need to be standard straight quotes for them to be understood by BASH. So replacing the quotes in your post by retyping them did the trick.

Now, if only I could get the service to actually show in Preview! Although it is set to be available to any app offering text, it doesn't appear in the Preview menu. (Appears fine in other apps like Notes which makes me wonder if Preview does not consider a text selection in a PDF as "text".)