| [reply] |
Well.... yeah. what you described is basically half of what I was suggesting.
with Clipboard you can get things from the clipboard, and put things into the clipboard. So you could remove the upper textarea from your UI completely, and just have the (lower) textarea for the perl code, and the "eval" button. Users "copy" arbitrary text in any app so that it is in the clipboard, click the "eval" button, and your app can fetch from the clipboard, run the perl code over it, and put it back in the clipboard. no pasting/re-coping required.
(it would basically be the same as the "clipfilter" script that comes with Clipboard except that instead of executing a single command line app, it would eval code from the textarea)
| [reply] |
Yeah, the only problem with removing the top text area is I often need to look at the text I'm "stringilizing". For instance, when I paste in tabular data from different sources, sometimes the columns are separated by tabs, sometimes other whitespace, and sometimes bizarrely. It helps to see the data after it's been converted to plain text to get the pattern replacement right.
I am going to try and implement the Clipboard module, though. It would be easy to add another button to process the clipboard directly, as you suggest, saving the copy-paste steps. I could see how this would be very convenient.
| [reply] |
This is very cool! This is the kind of thing I find myself making for odd jobs too. I have, as the commenter suggested, used Win32::Clipboard to eliminate the gui entirely though.
The user would click on an icon to start the program and then anytime they copied text that matched a specific regex into the clipboard, it would be replaced with the munged text, so they could just cut, paste, cut, paste..
If I can dig it up I'll post it.
| [reply] |