Well, ok. A challenge was issued to convert the html-converting bookmarklet script from Scriptygoddess to work in mozilla, and well, I can rarely resist a challenge.
However, I started wondering why I should limit myself to Firebird or even to a cross-browser Firebird, IE and Opera script, when I want this functionality in all my applications. So of course, I ran off to my scripts cache and found I’d already written most of this a while back, just not for this purpose.
Of course, the catch is that this is a WSH script, which means it will only work in Windows™, and therefor probably won’t win me any thanks from the people who are already involved, but hey, it works in any application (even your Office apps [ ]), so you might find it useful anyway!
Here’s the deal: You’ll need my scripting toolkit if you don’t already have it. That said, you can download the DeHTML script on it’s own or get the DeHTML script and the ToolKit all in one blow
If you do download the toolkit, make sure you unzip it, put the JToolKit.dll somewhere, and run “regsrv32.exe JToolKit.dll” to tell windows where to find it (you almost certainly need to type the full path to JToolKit.dll).
Once that’s done, my suggestion is to bind a hotkey to the script. The easiest way to do that is to put a shortcut to the script somewhere in your start menu, and then right-click the shortcut and open it’s Properties page. Click in the “shortcut key” box and press the key combination you want to use (such as CTRL+SHIFT+H). That’s it, you’re done.
Now you should be able to select text in any application and just press your hotkey to have all the > and < characters in the selected text converted to their respective entities. In fact, if you have a look at the source code for that script, I think you’ll find it incredibly easy to add more characters you want replaced too, or even to modify it to reverse the process.
Similar Posts:
- None Found
So, you have done it, Jaykul? Can I use it to put a quick link on my Mozilla link bar? If it works for me, I will contact you to get your Wish List info.
Well, yeah, in a manner of speaking. [
] It works great, in any application … as long as you’re on Windows.
I’m not sure how well it will work on your browser bar (I use it as a hotkey, as I described above). IE could run it from the browser bar, since they support application shortcuts there, but I think Mozilla will try to open it. [
] On top of which, when I tried links on the browser bar clicking them took the focus away from the selected text, which means nothing really happens [
]
Ok, I see. Hm. I wonder how to make it a bookmark so I could drag it to the link bar? Like a bookmarklet…I will have to try it.
Thanks!
Well, I think I can solve that too, if you want …
I wrote this a while back: http://jaykul.huddledmasses.org/scripting/run_protocol_handler.php
I can change that script to register a specific (user-specified, of course) script-only protocol, so it wouldn’t pop up the confirmation and the console (since those prevent scripts from doing their jobs).
However, I’m not sure that will solve it 100%, since the focus issue may still persist … did you try it as a hotkey?
I use Macro Express and it’s really good for what it is, but has no javascript support. I also use EditPadPro, and it’s really good at what it does, but the author won’t put in macros. (He’s got some kinda-macro-ish things). With your DLL I am now able to work with Macro Express more closely, spitting out [RegExp]ed text. I am VERY happy to have found this. THANKS!!