Jump to content

Windows + Printscreen


Go to solution Solved by Musashi,

Recommended Posts

Hi Guys,

 

im new here and need some help

 

i`ve made the following code:

Sleep ( 5000 );
Global $x
for $i = 1 to 2 step 1
     Send("{Lwin down}")
      Send("{printscreen}")
      Send("{LWIN up}")
   sleep(500)
   Send("{DOWN}")
   Sleep(3000)
Next

 

The problem is the following it doesn`t do both of them at the same time Win + Printscreen what would make a screenshot with win 10.

 

Any Ideas what i could do?

 

I`ve also tried this:

Sleep ( 5000 );
Global $x
for $i = 1 to 2 step 1
      Send("{printscreen}{Lwin down}")
   sleep(500)
   Send("{DOWN}")
   Sleep(3000)
Next
 

 

would be really nice if someone would help :)

 

Thank you

 

 

Link to comment
Share on other sites

Okay That works great. 

 

The Issue now is that i dont know how to change the Filename here.

 

e.g i want it to be Picutre1, Picture 2 etc. 

 

so now my code looks like this:

#include <ScreenCapture.au3>

Global $x

For $x = 1 to 5 Step 1
   $sFileName =
   _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg")

    ShellExecute(@MyDocumentsDir & "\GDIPlus_Image1.jpg")


Next

 

Thanks again for the help :)

Link to comment
Share on other sites

  • Solution
14 minutes ago, Comfsolo said:

e.g i want it to be Picutre1, Picture 2 etc. 

#include <ScreenCapture.au3>

;Global $x ; <== Superfluous ! The variable $x will be declared by For ... Next
Global $sFileName
For $x = 1 To 5 Step 1
    $sFileName = @ScriptDir & "\Picture" & $x & ".jpg"
    ConsoleWrite($sFileName & @CRLF) ; *** just for test
    _ScreenCapture_Capture($sFileName)
    ShellExecute($sFileName)
Next

Thus, the script still makes little sense, since five screenshots are taken quasi simultaneously ;). Please describe what exactly you want to achieve.

 

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

Thanks Mate you really helped me alot

 

The End code looked like this:

 

#include <ScreenCapture.au3>

;Global $x ; <== Superfluous ! The variable $x will be declared by For ... Next
Global $sFileName

sleep(10000)
For $x = 1 To 286 Step 1
    $sFileName = @ScriptDir & "\Buch" & $x & ".jpg"
    ConsoleWrite($sFileName & @CRLF) ; *** just for test
    _ScreenCapture_Capture($sFileName)
    sleep(400)
    Send("{DOWN}")
    sleep(5000)
Next
 

 

And its sole purpose was to make screenshots of an e Book that i couldnt Download and that always forced you to load the next page for it to be shown in the HTML Code.

 

It worked wonderfully and i maybe even safed some time.

Link to comment
Share on other sites

10 minutes ago, Comfsolo said:

It worked wonderfully and i maybe even safed some time.

You are welcome :).

Aside :
The line :

[...]
;Global $x ; <== Superfluous ! The variable $x will be declared by For ...Next
[...]

can be removed. As I said, it is superfluous. If you want, you can also mark the contribution that helped you as a solution ;).

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...