Zatsumi Posted June 23, 2010 Share Posted June 23, 2010 Tooltip("ScreenShot", 0, 0) HotKeySet ( "{f5}" , "ScreenShot" ) HotKeySet ( "{Esc}" , "Terminate" ) MsgBox ( 0, "ScreenShot" , "Press OK to continue." ) Func Terminate () Exit 0 EndFunc Func ScreenShot() Local $hBmp $hBmp = _ScreenCapture_Capture ("") _ScreenCapture_SaveImage ( "C:\Users\______\Documents" & "\asdfjk.jpg" , $hBmp ) EndFunc While 1 Sleep (100) WEnd Link to comment Share on other sites More sharing options...
Spiff59 Posted June 23, 2010 Share Posted June 23, 2010 After adding the required include file (#include <ScreenCapture.au3>) it works just fine. Link to comment Share on other sites More sharing options...
Zatsumi Posted June 23, 2010 Author Share Posted June 23, 2010 Oh that worked, thanks. Say I want it to save as a different name every time without having to replace older images, how can I do that? Link to comment Share on other sites More sharing options...
twitchyliquid64 Posted June 23, 2010 Share Posted June 23, 2010 Oh that worked, thanks.Say I want it to save as a different name every time without having to replace older images, how can I do that?Simply use a prompt for a filename, and store it as a variable, which you can use.EG:$filename = Prompt( "FIlename please.", "Filename please.")And replace your filename string ( "blah blah") with $filename.NOTE: I'm pretty sure I got the syntax and maybe even command name for the prompt Wrong; you will need to type it into help to check.HYPOz ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search Link to comment Share on other sites More sharing options...
DW1 Posted June 23, 2010 Share Posted June 23, 2010 (edited) You could loop through a filename with an increasing number at the end of it until you find a filename that doesn't exist, so you end up with: screenshot0001.jpg, screenshot0002.jpg... etc. OR What I would do, Just append EPOCH time to the end of the file, so when viewing them in alpha numeric order, the newest will be on the bottom, oldest on top, and the number will actually be relevant to the time the screenshot was taken. Like this: #include <ScreenCapture.au3> #include <date.au3> ToolTip("ScreenShot", 0, 0) HotKeySet("{f5}", "ScreenShot") HotKeySet("{Esc}", "Terminate") MsgBox(0, "ScreenShot", "Press OK to continue.") Func Terminate() Exit 0 EndFunc ;==>Terminate Func ScreenShot() Local $hBmp $hBmp = _ScreenCapture_Capture("") _ScreenCapture_SaveImage(@MyDocumentsDir & "\screenshot - " & _DateDiff('s', "1970/01/01 00:00:00", _NowCalc()) & ".jpg", $hBmp) EndFunc ;==>ScreenShot While 1 Sleep(100) WEnd Edited June 23, 2010 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
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