|
#1
| |||
| |||
| Piping text to Clipboard? I find my self spending quite a bit of time in the terminal, and the work I do has me constantly taking some bits of information from the terminal and pasting them into other applications. I'm looking for a nice way to get text from the terminal to the clipboard. Something like: "pwd > Clipboard" I know that's never going to work but what I'm asking is if there's a semi nice way to do this, maybe piping the text to an apple script that will then place that text into the clipboard? Does this even make sense to anyone? |
|
#2
| ||||
| ||||
| Hmm. I tried rigging up an AppleScript using the osascript command, but as far as I can tell osascript will never accept script arguments from stdin. Bummer. You can do it with angle-quotes, but only if the output has no spaces or other non-shell-friendly characters. Looks like macosxhints has the answer, though. http://www.macosxhints.com/article.p...03050204544799 It's as simple as: Code: pwd | pbcopy ![]() |
|
#3
| |||
| |||
| Yes, it does. There seems to be a service called pboard. Also, there are two commands, pbcopy and pbpaste that use the service. $ pwd | pbpaste does what you asked. (All this I got by typing "man -k paste", which gave pboard, and then "man -k pboard") |
|
#4
| |||
| |||
| Ooops! Mikuro already answered when I was typing my answer. Also, I should have used pbcopy instead of pbpaste. |
|
#5
| |||
| |||
| OOhhhh fantastic. I was really hoping something like that existed, GO APPLE. I spend alot of time looking for something like this on os x hints but I guess I was searching for the wrong things. Thanks guys |