Jump to content

Script that takes ss of certain window every 15 minutes.


Go to solution Solved by JohnOne,

Recommended Posts

Posted

Hello, im trying to make script that takes screenshot of certain window every 15 minutes. This is my code atm.

#include <ScreenCapture.au3>

$var = 0;

Do
$timer=TimerInit()
Sleep(5000)
$seconds=Round(TimerDiff($timer)/1000,2)
If IsInt($seconds) Then $seconds&=".00"
$date = @MDAY & "/" & @MON & "/" & @YEAR
_ScreenCapture_Capture("C:\Users\Mursa\Pictures\ProPilk2\" & $var & "_" & $date & ".jpg")
Until $var = 10;

So basically i'm missing the targeting to certain window.

Posted

I have a script in my signature called ICU that accomplishes (more-or-less) what you are trying to do.

I was able to capture a specific window using the following funcs:

$activewin = WinGetTitle("")
$activewin = WinGetHandle($activewin)
_ScreenCapture_CaptureWnd($filename,$activewin)

 

Modify as necessary/

Posted (edited)
#include <ScreenCapture.au3>


$activewin = WinGetTitle("Calculator") ;Modified here window Title & didin't work
$activewin = WinGetHandle($activewin)
_ScreenCapture_CaptureWnd("C:\Users\MYUSER\Pictures\image1.jpg" ,$activewin)
Edited by Mursa
Posted

I'm afraid you'll have to do a little better than that.

Well could you give me helping hand instead of telling that? I'm beginner and wan't go get my code working. 

; Autoit window gives me these results on the window

;Title: Pro Pilkki 2
;Class: MainWClass
;Position: -8,-8

;Controls > Empty
Posted

I want to take screenshot of specified window that is not the current window shown. Example my window is down there minimized and i want to take picture at it.

Posted

Certainly is.

WinActivate() should do the trick.

EDIT:

In fact WinSetState() might be better, for both restoring and minimizing the window.

 

WinSetState() works like charm, ty :)

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
×
×
  • Create New...