Hi,
That is my first "big" contribution to the AHK community, so please be lenient, because I am a very sensitive person !!!
OK, it's a joke. So don't hesistate to make comments, suggestions to improve the code.
What is the purpose of this script ?
I think that like me, you like to see the posts in the forums, and that you want to keep the pieces of code which are shared by the scripters. But I think taht if the code alone is usefull, it is also usefull to have the text of the interventions, to have explanation of what the code do, what is interesting in it and so on. I always learn from the codes posted by Chris (of course !!!), Laszlo, shimanov, PhiLho, toralf, BoBo, Rajat, Titan, Goyyah, Micha, and so many others, but I learn more things if I can keep what they says about the reasons they do the things like that, why they think this way to do the things is better and so on.
To keep the interventions, I was copying the text of each page in the clipboard and then past it in notepad. Then I put away manually what was not usefull. So I made this script to clean what is taken on the forum with the clipboard (so only pure text, I don't use the source of the page, for now....)
How does it works ?
At first I must say that it would have been possible to automate the recovery of the text, but I didn't do that because :
- I haven't too much time,
- there are some (little) differences, depending of the browser you use, for the recovery procedure, so it would be necessary to make a recovery procedure with borwser specific instructions, to determine the one which is used, and so on...
- When you are on a topic page, only the title of the topic is displayed in the title bar of the browser, so if you want to automatically activate the good window, you can't. You can only work with the active one.
- It's so simple to do it manually, that it isn't necessary to automate it. It isn't necessary to automate all the things !!!
- I'm lazy !!!
So I get the text manually :
- I start notepad with a blank page.
- Alt-Tabbing to go to the browser.
- I display the first (or unique) page of a topic.
- I type ^a^c (to copy all the page...)
- Alt-Tab to go back to notepad.
- ^v to paste the text in notepad
- Alt-Tab to come back to the browser
- click on the text "next"
- and so on for each page if there are many
At the end you have (of course !!!!) the text in the notepad window.
Type the shortcut (I put CTRL-ALT-S) and you will see the result.
You have the title of the subject, 3 blank lines, the pseudo surrounded by square brackets, the intervention, then 3 blank lines and so on...
I have too my planned features. I will work on them as soon as I can, but I wanted to post already the core of the code, as I don't know when I will have time to do so.
Of course you can use an other editor rather than notepad, change the line "IfWinActive, ahk_class Notepad,, ini ahk" and eventually the lines with ControlGetText and ControlSetText, if necessary.
I hope it will be usefull. Now, after too much words, the code.
Change history
2006-09-06 : v0.2 Just a little change. No more need to modify the number of pages in the last "Page xx of xx" of the capture, all the pages of the capture are proceed, whatever the number of pages is.
2006-09-05 : v0.1 (initial release)
I replaced the code section by a link to the source :
Mr Clean.ahk
I add the exe :
Mr Clean.exe
Here is the source for Mr Clean for the AutoIt forum :
Mr Clean AI.ahk
And the exe :
Mr Clean AI.exe