Posts Tagged ‘Command Line’
Clip.exe and the missing Paste.exe
One of the guys on #PowerShell in IRC was asking about how to get the contents of the clipboard in PowerShell, and after we had tried several different scripts, we realized that in Version 1, because PowerShell runs in an MTA thread, you cannot access the clipboard without creating a new thread (in STA mode). After I got done ranting, and pointing out that everyone needs to use PowerShell v2 (yeah, it’s still in CTP, so I was mostly kidding) in -STA mode … I whipped together the C# one liner and stuck it into a class with instructions for compiling, and figured I might as well share.
The code is below. There are two files: Clip.cs and Paste.cs … you probably only need Paste.cs, because Clip.exe is already included in Windows after Windows XP, but for the sake of completeness (and because it was just a few lines), I wrote them both.
To use them, you must compile them using Csc.exe, which is included as part of the .Net Framework. If it’s not already on your path, it’s in the folder for your most recent .Net Framework version (eg: C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe or C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe). All you have to do is run: csc Paste.cs and csc Clip.cs and you should end up with a Paste.exe and Clip.exe which you can use to copy and paste from the command-line… Read the rest of this entry »
On user interfaces, and command lines
I just discovered ubiquity, a Firefox plugin from Mozilla labs which is really just a sort-of alpha concept preview of a new command-line interface for the web browser that they are working on.
It’s extremely cool
Ubiquity for Firefox from Aza Raskin on Vimeo.
You should watch the video, the stuff they’re doing already is kind-of exciting. It reminded me a lot of PowerShell, so I started digging around some blogs and trying to figure out where they are going, and what their inspiration is … and now I’m really quite excited about it
and you should be too. Won’t it be cool when you can tell Firefox something like:
Hey Firefox? Take this text from this page, translate it to Spanish, encrypt it with my mom’s public key, email it to her … and oh yeah save this chain of commands as a new command so I can use it later.
That’s the vision of jono over at Mozilla Labs, and it sounds pretty good to me
Although I couldn’t help but think that if I could access PowerShell from my browser and pipe in the selected text, I could do pretty much all of that with existing commands
Anyway, I thought I’d give you a few links to read about the concepts of expressive, composable, linguistic, and partially graphical interfaces. And then later on, I’ll show you mine.
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=1e94f97f-aa32-4fd7-bc12-1d0f3c0f2877)