hamudi2002 Posted May 27, 2009 Posted May 27, 2009 (edited) hey every budy iam newer in this forum << and like autoit 3 ihave alittle question #include <ScreenCapture.au3> _ScreenCapture_Capture(@DesktopDir & "\problem.jpg")this code capture the desktop and save the picture on desktop by name problem.jpghow can i save the picture by date or time the PC ?? with jpg or gif Edited May 27, 2009 by hamudi2002
MrMitchell Posted May 27, 2009 Posted May 27, 2009 Here's one way, the easy, lazy way... #include <ScreenCapture.au3> _ScreenCapture_Capture(@DesktopDir & "\problem" & "_" & @MON & @MDAY & @YEAR & ".jpg")
Juvigy Posted May 27, 2009 Posted May 27, 2009 Check the time / data functions form the help reference. _Now() / _NowCalc() / _NowCalcDate()
hamudi2002 Posted May 27, 2009 Author Posted May 27, 2009 Here's one way, the easy, lazy way... #include <ScreenCapture.au3> _ScreenCapture_Capture(@DesktopDir & "\problem" & "_" & @MON & @MDAY & @YEAR & ".jpg") thanks my friend but the cod save only owne picture i will that save this picture by serial example: problem_05272009 < problem_052720092 < problem_052720093 like that can you help me
MrMitchell Posted May 27, 2009 Posted May 27, 2009 (edited) What I gave you was for demonstration purposes, even though it works. You need to read and understand what I did then tweak it to your liking. There are more macros you can use in addition to the three I already used (@MON, @MDAY, @YEAR), they are @HOUR, @MIN, @SEC. We'll let you figure out how to use them... If you're trying to serialize them like you just described (by using consecutive numbers rather than the current time), there's a little more code involved. I suggest you make the attempt yourself first then post what you need help with. Edited May 27, 2009 by MrMitchell
hamudi2002 Posted May 27, 2009 Author Posted May 27, 2009 thanks alot MrMitchell for your helpingi dow that code by date#include <ScreenCapture.au3> _ScreenCapture_Capture(@DesktopDir & "\problem" & "_" & @MON & @MDAY & @YEAR & ".jpg")and this by hour#include <ScreenCapture.au3> _ScreenCapture_Capture(@DesktopDir & "\problem" & "_" & @HOUR & @MIN & @sec & ".jpg")ok this codes save only owne picturehow can i make the code by save serialize picture !!may I use (if) function !!
MrMitchell Posted May 27, 2009 Posted May 27, 2009 You may want to have a variable in your script to use as a counter that increases by one every time you take a screenshot. #include <ScreenCapture.au3> Dim $count $count = 0 ;initialize to zero _ScreenCapture_Capture(@DesktopDir & "\problem" & $count ".jpg") ;capture screen and append the value of $count to create problem0.jpg $count += 1 ;increase count by 1, so now it equals 1. Next screenshot will be problem1.jpg
Danny35d Posted May 27, 2009 Posted May 27, 2009 Combine the Date and Time together.#include <ScreenCapture.au3> _ScreenCapture_Capture(@DesktopDir & "\problem" & "_" & @MON & @MDAY & @YEAR & '_' & @HOUR & @MIN & @sec & ".jpg") AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
hamudi2002 Posted May 27, 2009 Author Posted May 27, 2009 You may want to have a variable in your script to use as a counter that increases by one every time you take a screenshot. #include <ScreenCapture.au3> Dim $count $count = 0 ;initialize to zero _ScreenCapture_Capture(@DesktopDir & "\problem" & $count ".jpg") ;capture screen and append the value of $count to create problem0.jpg $count += 1 ;increase count by 1, so now it equals 1. Next screenshot will be problem1.jpg i apply this code but this one errore !! idont noe where is yhe erore ? but this code ithink is what i want how a fix the erroe ?
MrMitchell Posted May 28, 2009 Posted May 28, 2009 i apply this code but this one errore !!idont noe where is yhe erore ?but this code ithink is what i wanthow a fix the erroe ?Ummm...maybe just use Danny's example. Yes.Just curious, how often do you plan on taking a screen shot using this script?
Tec Posted May 28, 2009 Posted May 28, 2009 _ScreenCapture_Capture(@DesktopDir & "\problem" & $count & ".jpg")
Danny35d Posted May 28, 2009 Posted May 28, 2009 Try it:#include <File.au3> #include <ScreenCapture.au3> $FilePath = @DesktopDir $FileName = 'Problem' $FileList = _FileListToArray($FilePath, $FileName & '*.jpg', 1) If Not IsArray($FileList) Then $FileName &= '1.jpg' Else $FileName &= $FileList[0] + 1 & '.jpg' EndIf _ScreenCapture_Capture($FilePath & "\" & $FileName) AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
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