Comfsolo Posted June 9, 2021 Posted June 9, 2021 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
Guest Posted June 9, 2021 Posted June 9, 2021 The following functions might be of interest : _ScreenCapture_Capture / _ScreenCapture_CaptureWnd
Comfsolo Posted June 9, 2021 Author Posted June 9, 2021 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
Solution Guest Posted June 9, 2021 Solution Posted June 9, 2021 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.
Comfsolo Posted June 9, 2021 Author Posted June 9, 2021 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.
Guest Posted June 9, 2021 Posted June 9, 2021 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 .
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now