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 

Intenet Explorer 'WebURL Saver'

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
[二oO也



Joined: 22 Feb 2005
Posts: 60
Location: Sweden

PostPosted: Tue Apr 04, 2006 6:06 pm    Post subject: Intenet Explorer 'WebURL Saver' Reply with quote

Hi everybody!

I'm trying to create a little script that with only the push of a button will save all the current URL's in all IE windows, since I (by various reasons) sometimes have to shut down all windows and log out.

So I got tired of 'faving' all my windows, to be able to continue with my surfing later.

I created some code, but it isn't very robust; it often gets the same URL twice and so on...

Maybe someone could help me improve it... Wink

Code:

TitleMatchMode = slow
SetTitleMatchMode, 2
Filedelete, IE WS Log.txt
WinMinimizeAll
GroupAdd, IEWindows, Microsoft Internet Explorer provided by Peab
GroupActivate, IEWindows, R ;Activate all Internet Explorer windows

WinGet, IECount,Count, Microsoft Internet Explorer provided by Peab

loop, %IECount%
{
WinGetText, WText, Microsoft Internet Explorer provided by Peab

stringmid, WText, WText, % InStr(WText, "`n"), % InStr(WText, "`n",0,InStr(WText, "`n")+1) - InStr(WText, "`n") ;In other words: Start searching at the end of first row = retrieve entire 2nd row!
msgbox, WText = %WText%
fileappend, `n%WText%, IE WS Log.txt

send, {Alt down}{Tab %A_Index%}{Alt up} ;Switch window
}
exitapp


ThanX!
_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)
Back to top
View user's profile Send private message Visit poster's website
BoBo
Guest





PostPosted: Tue Apr 04, 2006 6:29 pm    Post subject: Reply with quote

create an array of URIs and use the Sort command to get rid of duplicates.
Back to top
[二oO也



Joined: 22 Feb 2005
Posts: 60
Location: Sweden

PostPosted: Tue Apr 04, 2006 6:37 pm    Post subject: Hmm..Yes, I guess Reply with quote

Well, that will do the trick, but I think it's kind of a work-around.

Also, the script only loop, for example 3 times if there is only 3 IE windows. Then, if one URL is saved twice, one will of course be excluded.

ThanX anyway! Cool
_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Tue Apr 04, 2006 7:28 pm    Post subject: Reply with quote

Dear [二oO也, Smile

Try & tell me what you think of the following code:

Code:
FileDelete,URL.TXT
WinGet,WindowID,List,ahk_class IEFrame

Loop, % WindowID
{
cWindow = % WindowID%A_Index%
ControlGet,URL,Line,1,Edit1,ahk_id %cWindow%
FileAppend, %URL%`n, URL.TXT
}
Run, URL.TXT


Regards, Smile
_________________
Back to top
View user's profile Send private message
not-logged-in-daonlyfreez
Guest





PostPosted: Tue Apr 04, 2006 7:33 pm    Post subject: Reply with quote

Or, use a JavaScript/Bookmarklet... like this one that will enumerate all links on a page and present it in another window: (from here)

one-line-JavaScript (remove linebreaks)
Code:
javascript:WN7z=open('','Z6','width=400,height=200,scrollbars,resizable,menubar');
DL5e=document.links;with(WN7z.document){write('<base target=_blank>');
for(lKi=0;lKi<DL5e.length;lKi++){write(DL5e[lKi].toString().link(DL5e[lKi])+'<br><br>')};
void(close())}
Back to top
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Tue Apr 04, 2006 7:51 pm    Post subject: Reply with quote

It can be done simply:
Code:
WinGet, ID, List, ahk_class IEFrame
Loop, %ID% {
   ControlGetText, URL, Edit1, % "ahk_id" ID%A_Index%
   FileAppend, %URL%`r`n, IELog.txt
}
You can replace 'IELog.txt' on the line before the last. WinGet gets a list of window IDs that have the 'IEFrame' class (i.e. IE - pun intended Razz) btw.
_________________

Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Tue Apr 04, 2006 8:04 pm    Post subject: Reply with quote

Thanks Titan, Very Happy

Titan wrote:
ControlGetText, URL, Edit1, % "ahk_id" ID%A_Index%

I was struggling with that part highlighted in Green

Regards, Smile
_________________
Back to top
View user's profile Send private message
[二oO也



Joined: 22 Feb 2005
Posts: 60
Location: Sweden

PostPosted: Tue Apr 04, 2006 8:07 pm    Post subject: Reply with quote

Hi guys!

Thanks for your respond!

Unfortunetly none of your scripts seem to work (on my computer?)... Sad
(The log files created contain nothing...)

However, you gave me some ideas that I can work with for a while.

BUT DON'T STOP POSTING!! Wink Very Happy

ThanX again!
_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)
Back to top
View user's profile Send private message Visit poster's website
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Tue Apr 04, 2006 8:15 pm    Post subject: Reply with quote

[二oO也 wrote:
Unfortunetly none of your scripts seem to work (on my computer?)... Sad
(The log files created contain nothing...)
1. Open a few internet explorer windows at different websites
2. Run my script above
3. Look for the file 'IELog.txt' in the same directory you ran the script (unless you changed the location of the file)

I tried and tested it myself, and it worked Cool
_________________

Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Tue Apr 04, 2006 8:34 pm    Post subject: Reply with quote

Titan wrote:
I tried and tested it myself, and it worked Cool


My Code is tested too & runs okay!

Regards, Laughing
_________________
Back to top
View user's profile Send private message
MyIE2, or Firefox
Guest





PostPosted: Tue Apr 04, 2006 10:34 pm    Post subject: Reply with quote

If you can,
try MyIE2, or Firefox with "save session" extension...
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Wed Apr 05, 2006 8:26 am    Post subject: Reply with quote

MyIE2, or Firefox wrote:
If you can,
try MyIE2, or Firefox with "save session" extension...
Good advice, I was about to give it. Smile And Firefox + Tab Mix Plus is able to recover the tabs from a crash/brutal shutdown.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
[二oO也



Joined: 22 Feb 2005
Posts: 60
Location: Sweden

PostPosted: Wed Apr 05, 2006 4:09 pm    Post subject: Reply with quote

To Goyyah:

ThanX, your script works! The only thing I had to do is to change Edit1 to Edit2 to fit my IE version (or something.. Razz )

I'm also currently exploring the features of MyIE that you recommended!

Keep up the good work, y'all! Cool

ThanX!
_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Wed Apr 05, 2006 5:21 pm    Post subject: Reply with quote

Dear [二oO也, Smile

You wrote:
To Goyyah: ThanX, your script works!


I'm happy about it Smile

..and one more thing!

Re: Microsoft Internet Explorer provided by Peab

Is that not too long ? It should occupy 40% of your Titlebar!

You may view my post : http://www.autohotkey.com/forum/viewtopic.php?p=53455#53455

where I have posted a Registry patch for changing it : Regpatch_001.ahk

Regards, Smile
_________________
Back to top
View user's profile Send private message
[二oO也



Joined: 22 Feb 2005
Posts: 60
Location: Sweden

PostPosted: Thu Apr 06, 2006 6:14 am    Post subject: Changing IE Title Reply with quote

Hi Goyyah!

I knew already how to change the title, but I just haven't had the motivation to change it, or something. Rolling Eyes

But now with your script I'll change it right away! Razz

ThanX!
_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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