 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
[二oO也
Joined: 22 Feb 2005 Posts: 60 Location: Sweden
|
Posted: Tue Apr 04, 2006 6:06 pm Post subject: Intenet Explorer 'WebURL Saver' |
|
|
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...
| 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 |
|
 |
BoBo Guest
|
Posted: Tue Apr 04, 2006 6:29 pm Post subject: |
|
|
| 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
|
Posted: Tue Apr 04, 2006 6:37 pm Post subject: Hmm..Yes, I guess |
|
|
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!  _________________ "Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955) |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Tue Apr 04, 2006 7:28 pm Post subject: |
|
|
Dear [二oO也,
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,  _________________
 |
|
| Back to top |
|
 |
not-logged-in-daonlyfreez Guest
|
Posted: Tue Apr 04, 2006 7:33 pm Post subject: |
|
|
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/
|
Posted: Tue Apr 04, 2006 7:51 pm Post subject: |
|
|
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 ) btw. _________________
 |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Tue Apr 04, 2006 8:04 pm Post subject: |
|
|
Thanks Titan,
| Titan wrote: | | ControlGetText, URL, Edit1, % "ahk_id" ID%A_Index% |
I was struggling with that part highlighted in Green
Regards,  _________________
 |
|
| Back to top |
|
 |
[二oO也
Joined: 22 Feb 2005 Posts: 60 Location: Sweden
|
Posted: Tue Apr 04, 2006 8:07 pm Post subject: |
|
|
Hi guys!
Thanks for your respond!
Unfortunetly none of your scripts seem to work (on my computer?)...
(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!!
ThanX again! _________________ "Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955) |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5382 Location: /b/
|
Posted: Tue Apr 04, 2006 8:15 pm Post subject: |
|
|
| [二oO也 wrote: | Unfortunetly none of your scripts seem to work (on my computer?)...
(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  _________________
 |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Tue Apr 04, 2006 8:34 pm Post subject: |
|
|
| Titan wrote: | I tried and tested it myself, and it worked  |
My Code is tested too & runs okay!
Regards,  _________________
 |
|
| Back to top |
|
 |
MyIE2, or Firefox Guest
|
Posted: Tue Apr 04, 2006 10:34 pm Post subject: |
|
|
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)
|
Posted: Wed Apr 05, 2006 8:26 am Post subject: |
|
|
| MyIE2, or Firefox wrote: | If you can,
try MyIE2, or Firefox with "save session" extension... | Good advice, I was about to give it. 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 |
|
 |
[二oO也
Joined: 22 Feb 2005 Posts: 60 Location: Sweden
|
Posted: Wed Apr 05, 2006 4:09 pm Post subject: |
|
|
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.. )
I'm also currently exploring the features of MyIE that you recommended!
Keep up the good work, y'all!
ThanX! _________________ "Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955) |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Wed Apr 05, 2006 5:21 pm Post subject: |
|
|
Dear [二oO也,
| You wrote: | | To Goyyah: ThanX, your script works! |
I'm happy about it
..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,  _________________
 |
|
| Back to top |
|
 |
[二oO也
Joined: 22 Feb 2005 Posts: 60 Location: Sweden
|
Posted: Thu Apr 06, 2006 6:14 am Post subject: Changing IE Title |
|
|
Hi Goyyah!
I knew already how to change the title, but I just haven't had the motivation to change it, or something.
But now with your script I'll change it right away!
ThanX! _________________ "Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955) |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|