Jump to content

Script that takes ss of certain window every 15 minutes.


Go to solution Solved by JohnOne,

Recommended Posts

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.

Link to comment
Share on other sites

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/

Link to comment
Share on other sites

#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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Solution

Certainly is.

WinActivate() should do the trick.

EDIT:

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

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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...