Jump to content

Capture - Logging script


 Share

Recommended Posts

Hello, i'm making a logging script. the script will be able to save screen captures to a spesified folder with hour and min in the name of image file.

here is the script

#include <ScreenCapture.au3>
$file = "C:\Documents and Settings\Administrator\Desktop\Scripts\MN\Screenshot"
$random = @hour
$random2 = @min
_Main()

Func _Main()
    Local $jpg

    $jpg = ("Screen Capture")

    ; Capture window
    _ScreenCapture_Capture($file & $random & $random2  "\.jpg", $jpg)

EndFunc   ;==>_Main

where i need help is at the $random part. i want $random & $random2 variables to write the time in the name of the image.

ty all in advance!

Edited by Cameltoe
Link to comment
Share on other sites

Way to make that WAY more complicated than need be. Just use the @HOUR and @MIN macros right in the _ScreenCapture_Capture function.

Also, it'd probably help if you use the correct syntax for the functions. ($jpg ..?)

#include <ScreenCapture.au3>
$file = "C:\Documents and Settings\Administrator\Desktop\Scripts\MN\Screenshot"
_ScreenCapture_Capture($file & @HOUR & @MIN & ".jpg")

This will create a screen capture: "C:\Documents and Settings\Administrator\Desktop\Scripts\MN\ScreenshotHHMM.jpg"

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