AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mr Clean

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Demokos



Joined: 28 Dec 2005
Posts: 95

PostPosted: Tue Sep 05, 2006 9:00 pm    Post subject: Mr Clean Reply with quote

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


Last edited by Demokos on Thu Sep 07, 2006 10:28 pm; edited 5 times in total
Back to top
View user's profile Send private message
Mr Clean
Guest





PostPosted: Tue Sep 05, 2006 10:31 pm    Post subject: Reply with quote

If I didn't like your script so much, I'd sue for copyright infringement. Laughing
Back to top
Demokos



Joined: 28 Dec 2005
Posts: 95

PostPosted: Tue Sep 05, 2006 10:51 pm    Post subject: Reply with quote

I know that I am only one pale imitation, Ô master, but it is by respect towards your extreme kindness that I dared to take this title of topic.
But a malefic spirit had punished my impudence, because when I apply my script on my topic, and only to this one, I obtain:
Code:
Mr Clean



[Demokos]
and only that (and it isn't a joke !!!), whenever i'm loggd or not !!! Why ? I don't know !!! I can't explain !!!
In all cases, thank you for the compliment.
Back to top
View user's profile Send private message
daonlyfreez



Joined: 16 Mar 2005
Posts: 856
Location: Berlin

PostPosted: Tue Sep 05, 2006 10:59 pm    Post subject: Reply with quote

Wow! Nice work Cool

And... I was just working on something equal, so, I might as well present it too... Razz

Here it is... Currently made to work with Internet Explorer only.




Edit: Removed code, replaced with download

Hmm, the ForumHTMLToText function is not shown correctly in the forum, so copy-pasting will generate errors...

Here is the download/view link instead: GetScriptFromAHKForum.ahk
_________________
My AHK stuff on: autohotkey.net, DropBox, dao4.me
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Sep 05, 2006 11:12 pm    Post subject: Reply with quote

Looks like he's already been kidnapped by an AU3 geek. (Hi, Larry Wink) Laughing
Back to top
daonlyfreez



Joined: 16 Mar 2005
Posts: 856
Location: Berlin

PostPosted: Tue Sep 05, 2006 11:26 pm    Post subject: Reply with quote

@Demokos: Err, now I realize your script does something different...

@Moderator: Would you be so kind to move my upper post to a new thread in Scripts & Functions then Confused )

@BoBo: I don't get the Larry reference...
_________________
My AHK stuff on: autohotkey.net, DropBox, dao4.me
Back to top
View user's profile Send private message
Demokos



Joined: 28 Dec 2005
Posts: 95

PostPosted: Tue Sep 05, 2006 11:27 pm    Post subject: Reply with quote

@ BoBo
Be quiet, I will not show my picture.
@ daonlyfreez,
You are welcome !!!
I'm so sorry, I tried your code but it doesn't work for me.
I tried it with IE. The URL and the title of the current topic are diplayed, but not contained code(s).
The purpose of my script isn't to get the code(s), but all the topic.
I have seen others scripts with which you select the code, type an hotkey to save it to a temp file and to save/execute it.
Probably yours is good but it don't work for me (XP SP2, mainly use Mozilla)

Edit : @daonlyfreez. It's OK. Your script is OK. First I selected the script, saved it and run it and it didn't work. I downloaded the ahk script with the link ans it works perfectly well... Appologies.
Back to top
View user's profile Send private message
Demokos



Joined: 28 Dec 2005
Posts: 95

PostPosted: Wed Sep 06, 2006 9:31 pm    Post subject: Reply with quote

Just a little change. See the version history in the first post for infos.
P.S : I don't know why but now I can proceed this post !!!
Back to top
View user's profile Send private message
Demokos



Joined: 28 Dec 2005
Posts: 95

PostPosted: Thu Sep 07, 2006 10:29 pm    Post subject: Reply with quote

Sorry Sorry Sorry Embarassed Embarassed Embarassed
It's my fault, my very great fault
But I done it. I know that I should never have done that. Shame on me!
My apologies !!!
I adapted my program so that it works with the AutoIt forum ( I want to use the Obj/COM functions while waiting to have the equivalent under AHK...)
So if you want to take the interventions in the AutoIt forum, follow the same procedure as for the AHK forum,except that the hotkey is CTRL-SHIFT-ALT-S
So if you want to use it, see first post...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group