Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 04, 2016, 08:33:15 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Packrat's tool for "Idea Surfing" the web  (Read 2136 times)

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 510
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
Packrat's tool for "Idea Surfing" the web
« on: October 16, 2014, 07:22:53 AM »
I once asked for this and got many suggestions for download managers that were either more than needed or didn't offer the methods I would like use.  This probably could be written in AHK if I was better at using it.

When "Idea Surfing"  I run across more than I have time to fully research.  I downloading trial software of all kinds that a month later I have no idea why or what it is for.  When I can remember to do it, I like to use the following process:

Create a sub folder inside Downloads with a name as close to the actual sitename as possible.
Change focus to that folder and save the complete link to the page I am on.
Save a single-file MHT webarchive of the page because often when I go back later, these sites are no longer there.
Then DL the item I went there for.
Last, open notepad to leave "additional_info.txt" I might find useful later.

I end up with a complete package in a folder that I can easily find by searching for any word that might appear in the txt file or mht title and organized by type of DL.

It would be nice if this could all be a right click download option offering "Where to save" showing the directory tree under Downloads so I could file it in a sub-folder by type such as AV software, Programming tools, Website Applications, or create a new category if necessary. 

My main objective could be accomplished by simply creating the mht file and embedding the hyperlink inside the title of the mht.  If that part could be automated I could just run it before downloading the file itself.

Call it a "Packrat's Dream DL Tool" 

I figured I might as well "Ask for the Sun and stars if asking for the Moon   :D
Add zipping the folder and all files when done and delete the original to save HD space and maybe even small enough to email the  package to anyone I am collaborating with.

(Might help keep any accidental "Malware" safely stored too!   :)      You never know these days!

lifeweaver

  • Member
  • Joined in 2014
  • **
  • Posts: 22
    • View Profile
    • Donate to Member
Re: Packrat's tool for "Idea Surfing" the web
« Reply #1 on: July 27, 2015, 02:10:33 PM »
Hi questorfla,

While I'm not sure on the exact requirements it sounds like you know some AHK so you could probably modify this solution to fit your exact needs.
Script runs on: Windows 7 Professional, AutoHotkey 1.1.15.04 Unicode build

To use:
  • Have script running
  • Have url of webpage you want to save in clipboard
  • Press Alt+z to activate script
  • Select folder you want the files in, optionally creating a folder via the provided dialog.
  • It's done and will open the 'additional_info.txt' file in Notepad++, the script will also put the folder path in your clipboard
  • If there is a problem saving the .mht file you'll see a messagebox

Quote
Save_Webpage_As_MHT(url, saveFile)
{ ; https://groups.google.com/d/msg/microsoft.public.scripting.wsh/97WUK2_3U_4/mZJyxKf_FfAJ
  message := ComObjCreate("CDO.Message")
  conf := ComObjCreate("CDO.Configuration")
  message.Configuration := conf
  message.CreateMHTMLBody(url)
  stream := message.GetStream()
  stream.SaveToFile(saveFile)
  message := ""
  conf := ""
  stream := ""
  IfExist, %saveFile%
    return true
  else
    return false
}

Open_File_With_Notepad_Plus_Plus(file)
{
  notepad_Plus_Plus_Path := A_ProgramFiles . "\Notepad++\notepad++.exe"
  
  IfNotExist, %notepad_Plus_Plus_Path%
    notepad_Plus_Plus_Path := A_ProgramFiles . " (x86)\Notepad++\notepad++.exe"

  Run, "%notepad_Plus_Plus_Path%" "%file%"
}

#IfWinActive
!z::

; Persume url was in clipboard when script was called
url := Clipboard

; Get download folder
downloadsFolder := SubStr(A_Desktop, 1, StrLen(A_Desktop) - 7) . "Downloads"

; Dialog to get selected folder and create .mht file save path
FileSelectFolder, selectedFolder, %downloadsFolder%,, Select a download folder
archiveSavePath := selectedFolder . "\webpageSnapshot-" . A_Now . ".mht"

if (!Save_Webpage_As_MHT(url, archiveSavePath))
  msgbox Problem creating %archiveSavePath% for url: %url%
else
{
  FileCreateShortcut, %url%, %selectedFolder%\link.lnk
  FileAppend,, %selectedFolder%\additional_info.txt

  Open_File_With_Notepad_Plus_Plus(selectedFolder . "\additional_info.txt")
  Clipboard := selectedFolder
}

return

Note: If you really wanted to have a way to use this via the 'right-click' you could modify the script to take a command line parameter and compile it, then add a 'right-click' menu option via regedit.exe similar to here.

Also you might be able to integrate with your favorite browser to use URLDownloadToFile.

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 6,137
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: Packrat's tool for "Idea Surfing" the web
« Reply #2 on: July 27, 2015, 09:29:52 PM »
I hadn't seen (or had forgotten) this thread until @lifeweaver's post above brought it up in my feedreader today.
On reading it, I realised that the ScrapBook :: Add-ons for Firefox could probably meet the requirements in the OP.
I often use use Scrapbook to save a web page and any downloadable files linked to on that page at the same time. It usually works just fine.
Each clipped page goes as a set of small files into a uniquely-named date-time folder in the Scrapbook directory, and is indexed and/or searchable through the Scrapbook manager and Windows Desktop Search, Everything, etc.

     Scrapbook - 01 Download options 01.png

     Scrapbook - 01 Download options 02.png

     Scrapbook - 02 Menu options.png


I'd recommend you try it out. It's an amazingly useful little information capture and management tool.
There are forks off the Scrapbook Add-on, which look quite useful, though they don't meet my peculiar requirements.