topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Tuesday April 16, 2024, 4:56 am
  • Proudly celebrating 15+ 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: IDEA: Drag Drop URL or Paste to save target to predefined destination  (Read 18241 times)

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Again another thing I seem to keep doing repetitively, which might find advantage in reduced steps.

Provide a window where a save destination can be defined
Window should have options for always on top or normal

Allow the user to past or preferably drag drop from a URL link and save the target for the link in 'Full HTML' format (Webpage complete - The one with the folder) or 'MHT'
 
Include auto rename to increment duplicate filenames.

Existing process
Right Click
Save target as
Select destination, which dependant on which window you come from may not provide the last used destination.
Change Filename if required
Though this does not provide Full HTML

To get Full HTML
Open link
File
Save as
Select Destination
Select Full HTML
Save


New process
left click
drag link to application window

It may only seem a small saving but after hundreds of links it can make a big difference

Does something already do this , and I have yet to find it?
Why an I Magician62? Because Magician1 thru 61 were gone. :)
« Last Edit: February 27, 2012, 12:58 PM by magician62 »

c.gingerich

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 748
    • View Profile
    • The Blind House
    • Donate to Member
Looking into this, I can make most of what you ask, but I can only display a Save-As dialog and you would have to choose the location, and press Save. The name of the webpage is set as the file name, but you can change it if needed.
« Last Edit: April 18, 2012, 12:35 PM by c.gingerich »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Sorry for not seeing this before, not been online much over the last few weeks. I am proof life can exist without computers ! :)

A question on the second use of the utility, would it default to the previously used save location? If so it could work.
One of the issue I have found when opening multiple internet explorers is that sometimes you get offered different default locations depending on which session or child from a session is uin use

Could the default location be defined in a config file ? Would that then allow for auto save?

Does the filename auto increment if a duplicate is found?
Why an I Magician62? Because Magician1 thru 61 were gone. :)

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
I could make you a script that would do all those steps automatically using AutoIt.
What browser do you use and what version?
 

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
I tend to run IE9 with the latest up/downgrades :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
I made the attached program using AutoIt. I attached the EXE and the source code file (AU3) inside the zip file. If you install AutoIt, you can run the program by double-clicking the AU3 file. (The advantage of doing it this way is that you can edit it yourself.)

To use this program, double-click the EXE. It runs in the background.
When you want to save a webpage, first copy a URL then press the shortcut key: CTRL+WindowsKey+S
Select the output format and click OK. (The default format is Webpage Complete.)
Webpages are saved to a folder on your desktop.

In Internet Explorer 9, you can copy a URL by right-clicking a link, then selecting "Copy shortcut." So if you use Internet Explorer, you would first right-click a link, select "Copy shortcut," then press CTRL+WindowsKey+S.

If you want a different shortcut key or other changes, let me know. One option is to have a separate shortcut key for each output format, Webpage Complete and MHT.

I didn't add the feature of automatically changing the file name if there are duplicates. First try it as is and let me know if you like it.

You can put the program in your Windows Startup folder and it will run when Windows starts up.

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Have AutoIt installed now :)

Not sure if its a bug, but  "\Saved Webpages\" does not get created.

I also tried putting the full path in, but to no avail

Could it be because I am using Win7-64 ?

Could it be because I use IE9-x64 and IE9-x86

Could it be I am missing something ? :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
I have the same system as you, Win7-64.
On Win7-64 you have to do the following:
- Right-click AutoIt3.exe (located at C:\Program Files (x86)\AutoIt3\AutoIt3.exe) and select Properties.
- Click the Compatibility tab.
- Click the checkbox next to Run this program in compatibility mode for, then select Windows XP (Service Pack 3).
Try it again and let me know if it works.
« Last Edit: May 31, 2012, 03:38 AM by shmuel1 »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Nothing obvious:(

What I am seeing is a window position shift on Ctrl+Win+S similar to what you get when dragging the URL icon to desktop,

No save folder is being created, and when manually created still nothing appears to be saved
Why an I Magician62? Because Magician1 thru 61 were gone. :)

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
OK figured it. The key combination was already in use!

Now if only there was a utility to say what combinations were in use already....Google...ActiveHotkeys....Donationcoder.... :)
The installer didn't work, but the portable version definitely did :)


I have only run a handfull of tests, but will take a further look this evening. Of the links I tried to save 50% were pages unable to be saved, but I got the 50% that could :)

The one improvement I can see so far would be auto closing the new tab after save
Why an I Magician62? Because Magician1 thru 61 were gone. :)

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
I added lines 62 to 66 to close the tab after saving it. See the attached.
Remember to edit the hotkey (in line 7) to something that is not in use.

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
Now if only there was a utility to say what combinations were in use already

Here's a free program for finding all your keyboard shortcuts:
http://www.rjlsoftwa...tility/shortcutkeys/

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Finally had a chance to have a good play  !:)  A question, what would I need to change to force HTML every time ( as it seems to be the option I am always using), and bypass the pop up dialogue?

I tried setting

$answer = 1

at line 30, but every time it sets the default name as tabs.htm

Why an I Magician62? Because Magician1 thru 61 were gone. :)

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
When you get tabs.htm as the file name, it means it's saving the page before it finished loading the desired webpage. I had that also, so I added some sleep time before saving the page. Since you are avoiding the dialog box, you need even more sleep time to let the page load before saving it.

Try adding Sleep(3000) before Line 46 Send("^s"). Adjust the sleep value to the amount of time that you need to load an average page.

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
That solved it :) Now i can put it to a real test, and maybe discover why some pages will not save and others will
Why an I Magician62? Because Magician1 thru 61 were gone. :)

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
Active scripting is probably why you can't save some webpages. See this article:
http://www.techsuppo...web-page-476334.html
I might be able to make a script to quickly disable/enable active scripting. Let me know if you are interested.

The other option is just to make a PDF file out of the page.
Here's a free program to print almost anything to PDF format:
http://www.bullzip.c...roducts/pdf/info.php

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Your probably right on the active scripting. Maybe it can be disabled at the beginning of the current script and re-enabled at the end. I suggest that method as I assume it may be left permanently disabled once run?

PDF doesn't really suit for the end result. Part of the concept was that in some of my use cases there is image content on webpages I want to save for future reference, and by saving in full HTML the required images from the destination page can be easily extracted from the created folder of files.

Have used the util for a couple of hours today, and it seems to work quite well, filename clashes seem to depend on which website I am using, so if it is possible to add an automatic rename option when it finds a clash, that would be superb.

Why an I Magician62? Because Magician1 thru 61 were gone. :)

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
OK, I have to work on those 2 items.

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
I added these lines to disable active scripting for the current windows user and enable it afterwards:
Code: AutoIt [Select]
  1. RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1", "1400", "REG_DWORD", "3") ; disables active scripting in the "Internet Zone"
  2. RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1", "1400", "REG_DWORD", "0") ; enables active scripting in the "Internet Zone"
I tested it on my computer and it did change the registry setting. Test it with some webpages that you couldn't save before and see if you can save them now.
I also added $answer = 1 to make it save complete webpages without asking you for the format, and I added sleep(3000) before saving the webpage to allow the page to load. If you use the attached (instead of editing your version), remember to edit the Hotkey.

In case you are interested, here's the page I used that explains how to disable active scripting via the registry.
http://www.cs.kuleuv...ctive-scripting.html
« Last Edit: June 18, 2012, 08:16 AM by shmuel1 »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Just downloaded the update, will give a thorough test over the weekend :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
Here's a new version. In this version I added the time at the end of the filename (in the format HH-MM-SS) to avoid duplicate filenames. If you want me to add the date also, that would be pretty easy.

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Seems to work for most of the pages I have tried, though here is an example of a page where the util doesn't work, so I wonder what is causing the failure.

http://www.ebay.co.u...;hash=item19d12725a9
Why an I Magician62? Because Magician1 thru 61 were gone. :)

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
It apparently has something to do with the filename when saving the webpage. It happens with or without the macro. I removed part of the filename and it saved OK. I would say the filename was too long but it's within the Windows filename length limit and there are other names that I successfully saved that are longer. So I'm a bit stumped by what's wrong with the filename.

I edited the utility to allow you to edit the filename when there is an error saving.

Try the attached version with the page that didn't work:
http://www.ebay.co.u...;hash=item19d12725a9
« Last Edit: July 08, 2012, 10:15 AM by shmuel1 »