tsolrm Posted January 21, 2012 Posted January 21, 2012 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?
Developers Jos Posted January 21, 2012 Developers Posted January 21, 2012 (edited) Have you checked what exactly is returned by the _NowDate() UDF? Edited January 21, 2012 by Jos tsolrm 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
kylomas Posted January 21, 2012 Posted January 21, 2012 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 tsolrm 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
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