Copy plain text content of RTF file to clipboard

My Hazel is watching a special folder for RTF files and I want to get the content of any new RTF file in my clipboard. I am using a shell script for that:
This works in the Terminal, but not in Hazel, I am always getting an empty clipboard there.
Is there a solution for this?
- Code: Select all
#!/bin/bash
textutil -convert txt -stdout $1 | pbcopy
This works in the Terminal, but not in Hazel, I am always getting an empty clipboard there.
Is there a solution for this?