AutoHotkey Community

It is currently May 27th, 2012, 7:35 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Mr Clean
PostPosted: September 5th, 2006, 9:00 pm 
Offline

Joined: December 28th, 2005, 10:46 am
Posts: 99
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 September 7th, 2006, 10:28 pm, edited 5 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 5th, 2006, 10:31 pm 
If I didn't like your script so much, I'd sue for copyright infringement. :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 5th, 2006, 10:51 pm 
Offline

Joined: December 28th, 2005, 10:46 am
Posts: 99
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 5th, 2006, 10:59 pm 
Offline

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
Wow! Nice work 8)

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

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

Image


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

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 5th, 2006, 11:12 pm 
ImageLooks like he's already been kidnapped by an AU3 geek. (Hi, Larry :wink:) :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 5th, 2006, 11:26 pm 
Offline

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
@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 :? )

@BoBo: I don't get the Larry reference...

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 5th, 2006, 11:27 pm 
Offline

Joined: December 28th, 2005, 10:46 am
Posts: 99
@ 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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2006, 9:31 pm 
Offline

Joined: December 28th, 2005, 10:46 am
Posts: 99
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 !!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2006, 10:29 pm 
Offline

Joined: December 28th, 2005, 10:46 am
Posts: 99
Sorry Sorry Sorry :oops: :oops: :oops:
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...


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: kurakura, nothing, Yahoo [Bot] and 9 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group