Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Print page after each click in browser  (Read 2285 times)

0 Members and 1 Guest are viewing this topic.

kovacsa

    Topic Starter


    Rookie

    • Experience: Beginner
    • OS: Unknown
    Print page after each click in browser
    « on: September 21, 2018, 03:34:41 PM »
    I would like to print pages after each click in Chrome. So script should perform a click and after that send "CTRL+P" to open printing dialog and "ENTER" to save page as PDF file by default. What kind of framework is a good choice for this framework? Are there any existing browser plugins for this purpose?

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Print page after each click in browser
    « Reply #1 on: September 22, 2018, 11:09:08 AM »
    So you need a keyboard/mouse macro to automate printing of pages from a website so that you don't manually have to print each page?

    kovacsa

      Topic Starter


      Rookie

      • Experience: Beginner
      • OS: Unknown
      Re: Print page after each click in browser
      « Reply #2 on: September 24, 2018, 12:31:04 AM »
      Yes, maybe it would be a solution.

      DaveLembke



        Sage
      • Thanked: 662
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Print page after each click in browser
      « Reply #3 on: September 24, 2018, 07:48:28 AM »
      Do you have a list of all URL's to hit to print pages from as well as do you know fast your computer is able to carry out the print job?

      I use a software called JitBit Macro Recorder that I can use to make keyboard/mouse macros. Only trick to fully automating this would be to have the correct time delays and a list to work with.

      Basically you can have a text file in notepad open with all URLs listed 1 per line. Your macro uses this list by taking the top most line and copy pastes that into the browser URL window and enter key is hit by the macro. The web page loads with whatever it is to print. Next the macro will CTRL+P and print it. If there are any dialog boxes that pop up the macro then selects what to do in those for your printer. Then its printed and moves on to the next URL by navigating by itself back to notepad and delete the first line and make all URL's below that move up a line. Then it takes that next line and does the same thing. You then need to know how many URL's your hitting so you can create an iteration counter to only have it run for as many URLs your hitting and this way it ends when done vs continuous loop.

      Best advice I have is to buy this software and create your own keyboard/mouse macro and use that process that can loop through all URLs until complete.

      The macro basically would be performing this step for one URL line and setting up the next URL line at the tail end of it. So that when the macro runs again it picks up with a new URL, BUT... it can run in a loop of redundancy and process all of these for you. The macro can be compiled into the form of an EXE and this EXE can be paved into a batch file for X-Many times you need it to run such as to run the macro 5 times and your macro is named RunMe1.exe you can enter the following in notepad and save it as Batch1.bat and when running Batch1.bat it will run the macro 5 times

      Here is a way to run the macro EXE 5 times

      Code: [Select]
      RunMe1.exe
      RunMe1.exe
      RunMe1.exe
      RunMe1.exe
      RunMe1.exe

      The JitBit Macro Recorder software is not that expensive and you can do just about anything automated with it. The hardest part of it is designing a process that can loop back on itself to seamless run over and over again, so the end of the macro instruction leads to prep for the start of itself again, so this means having certain windows open so when it clicks its clicking in the right window etc when it moves to an X/Y mouse location.

      Also its best to not rush through the process of recording the tasks to be completed per iteration. Such as between moving to the next thing to do pause for 2 or 3 seconds and then move on to the next step. When waiting for a webpage to load in the browser give it an extra 5 to 10 seconds before moving on to the next step of CTRL+P. This will give the computer more time to load and perform what needs to be done before doing what is to be done next, because if the webpage is slower to load than the speed at which you recorded the process, then it will CTRL+P with the page not loaded or partially loaded into the browser before it performs the CTRL+P and then it will malfunction on you where worst case scenario is that an error alert box pops up that takes the focus and then what needs to be accessed is behind that and the macro then is clicking in dead space and trying to paste a URL into a error alert box which wont accept it. So its important to give it plenty of padded time to do what needs to be done. If you have 1000 URLs though and the macro takes 1 minute to complete you then basically when running it wont be using your computer for 1000 minutes which is 16.7 hours. So when running this you cant use your computer at all. You need to hands off and let it do what you want it to do. If you grab your mouse and keyboard and type while its running BAD THINGS WILL HAPPEN!!! As you interrupted the automated process and it can then run out of control on you trying to copy paste information between windows that are up that aren't Notepad and Browser. ::)

      If you have many to run its best to have a 2nd computer to run this while you use your computer for gaming etc. That's one reason why I own more than 1 computer is so that I can run automated routines on other computers and still have a free computer available to game etc. If you only need 100 URL's processed then its not bad less than 2 hours of time for a 1 minute executed macro.

      Good Luck and its not hard to do. Very Easy!  ;D