Sign in to follow this  
Followers 0
tsolrm

_ScreenCapture_Capture

4 posts in this topic

MsgBox (0, "TEST", "TEST")

$Date=_NowDate()

$Time=_NowTime()

_ScreenCapture_Capture($Date&$Time&".jpg")

I'm trying to save a screenshot in the scripts directory with the name of the script being the date and the time but it doesn't work. But it works fine if I set the name manually for image (like _ScreenCapture_Capture("test.jpg")

any ideas please?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Have you checked what exactly is returned by the _NowDate() UDF?

Edited by Jos
1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

damn the answer was so simple. thanks

Share this post


Link to post
Share on other sites

tsolrm,

The code you posted will not run without adding a couple of #include stmts. Once you get it to run, and, follow Jos's advice you will see that the file name will contain "/" chars. These are invalid for a file name. Perhaps you want to do something like

#include <ScreenCapture.au3>
_ScreenCapture_Capture("c:tmp" & @YEAR & '-' & @MON & '-' & @MDAY & ' ' & @HOUR & @MIN & ".jpg")

kylomas

1 person likes this

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
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
Sign in to follow this  
Followers 0