Copy file opened in macOS preview to working directory

1 · Abin Simon · June 2, 2020, midnight
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 copy the file to my current location inside the terminal I have to look up the folder, filename and God help us if there are spaces in the filename in w...