Create a new .txt file?

Here’s a starting point.

For writing to files you will need to use a shell script action. Here I’m using zsh
but you could also use something like python or ruby.

I’ve set the filename to the current timestamp since that’s an easy way to get an unique-ish filename.
Getting the first few words is a bit more tricky, I’ll leave that as an exercise for the reader!

You can of course change the folder, extension name, icon etc.

#!/bin/zsh
# #popclip
# name: Save to .txt
# icon: txt
# stdin: text
folder=~/Documents
filename=$(date "+%Y%m%d-%H%M%S").txt
cat > $folder/$filename

(The above block is an extension snippet — select it then click “Install Extension” in PopClip.)

2 Likes