Jump to content
Sign in to follow this  
tsolrm

_ScreenCapture_Capture

Recommended Posts

tsolrm

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
Jos

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

Edited by Jos
  • Like 1

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

Share this post


Link to post
Share on other sites
kylomas

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

  • Like 1

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.