How to create a service that puts selected text into quotation marks?
One way is to create a service that runs a shell command.

For this, open Automator, create a new Service, check "Output replaces selected text", then add the action "Run Shell Script". In the box where you enter the Shell script write:

cat | sed 's/^/"/' | sed 's/$/"/' | sed 's/""//'


This takes the text you entered as input, and adds a quotation mark at the beginning and end.

Now, once you save your service, you can, for example, go to TextEdit, select the text you want to quote, then go to Services -> "name of your service", and your text should now be quoted!



Edit: I included the removal of trailing double quotation marks