Copy file opened in macOS preview to working directory

from blog meain/blog, | ↗ original
Another random script I pieced together recently. I generally have a bunch of temp folders that I keep around for files to go in. And at times, I have pull some files into the current folder I am working on in my shell. If those are pdf of image files, I usually have them open in macOS preview which btw is a neat tool. Anyhow, when I now have to...