Page 1 of 1

Play file path from clipboard

Posted: 20 Feb 2012 08:15
by sh4d0w
So my scenario is that I've copied a http link that I want to stream with vlc player to the clipboard. I would like to write a simple script that starts playing the file at the path on the clipboard. I've already tried

pbpaste | VLC -

pbpaste outputs the contents of the clipboard to stdout, so I was hoping VLC would then pick that up, read the path, and then play it, but apparently it expects an actual stream when you pipe things to it, not a filepath. I've tried something similar on windows that failed so I don't think this is OS-specific

Any thoughts?

Thanks,
sh4d0w

Re: Play file path from clipboard

Posted: 24 Feb 2012 19:29
by sh4d0w
posted this on stack overflow: http://stackoverflow.com/questions/9422 ... -clipboard

this rather simple and slightly mortifying one-liner does the trick: vlc -vvv $(pbpaste)