Jump to content

Whats Wrong?


Recommended Posts

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

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

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