Sign in to follow this  
Followers 0
hamudi2002

how can convert the file name to date name

13 posts in this topic

#1 ·  Posted (edited)

hey every budy

iam newer in this forum << and like autoit 3 :idea:

ihave alittle question :)

#include <ScreenCapture.au3>

_ScreenCapture_Capture(@DesktopDir & "\problem.jpg")

this code capture the desktop and save the picture on desktop by name problem.jpg

how can i save the picture by date or time the PC ?? with jpg or gif :party:

Edited by hamudi2002

Share this post


Link to post
Share on other sites



Check the time / data functions form the help reference. _Now() / _NowCalc() / _NowCalcDate()

Share this post


Link to post
Share on other sites

Here's one way, the easy, lazy way...

#include <ScreenCapture.au3>

_ScreenCapture_Capture(@DesktopDir & "\problem" & "_" & @MON & @MDAY & @YEAR & ".jpg")

thanks my friend

but the cod save only owne picture

i will that save this picture by serial

example:

problem_05272009 < problem_052720092 < problem_052720093

like that

can you help me

Share this post


Link to post
Share on other sites

Posted Image

Posted Image

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

What I gave you was for demonstration purposes, even though it works. You need to read and understand what I did then tweak it to your liking.

There are more macros you can use in addition to the three I already used (@MON, @MDAY, @YEAR), they are @HOUR, @MIN, @SEC. We'll let you figure out how to use them...

If you're trying to serialize them like you just described (by using consecutive numbers rather than the current time), there's a little more code involved. I suggest you make the attempt yourself first then post what you need help with.

Edited by MrMitchell

Share this post


Link to post
Share on other sites

thanks alot MrMitchell for your helping

i dow that code by date

#include <ScreenCapture.au3>

_ScreenCapture_Capture(@DesktopDir & "\problem" & "_" & @MON & @MDAY & @YEAR & ".jpg")

and this by hour

#include <ScreenCapture.au3>

_ScreenCapture_Capture(@DesktopDir & "\problem" & "_" & @HOUR & @MIN & @sec & ".jpg")

ok this codes save only owne picture

how can i make the code by save serialize picture !!

may I use (if) function !!

Share this post


Link to post
Share on other sites

You may want to have a variable in your script to use as a counter that increases by one every time you take a screenshot.

#include <ScreenCapture.au3>
Dim $count

$count = 0          ;initialize to zero
_ScreenCapture_Capture(@DesktopDir & "\problem" & $count ".jpg")    ;capture screen and append the value of $count to create problem0.jpg
$count += 1       ;increase count by 1, so now it equals 1. Next screenshot will be problem1.jpg

Share this post


Link to post
Share on other sites

You may want to have a variable in your script to use as a counter that increases by one every time you take a screenshot.

#include <ScreenCapture.au3>
Dim $count

$count = 0          ;initialize to zero
_ScreenCapture_Capture(@DesktopDir & "\problem" & $count ".jpg")    ;capture screen and append the value of $count to create problem0.jpg
$count += 1       ;increase count by 1, so now it equals 1. Next screenshot will be problem1.jpg

i apply this code but this one errore !!

idont noe where is yhe erore ?

but this code ithink is what i want

how a fix the erroe ?

Share this post


Link to post
Share on other sites

i apply this code but this one errore !!

idont noe where is yhe erore ?

but this code ithink is what i want

how a fix the erroe ?

Ummm...maybe just use Danny's example. Yes.

Just curious, how often do you plan on taking a screen shot using this script?

Share this post


Link to post
Share on other sites

_ScreenCapture_Capture(@DesktopDir & "\problem" & $count & ".jpg")

Share this post


Link to post
Share on other sites

Try it:

#include <File.au3>
#include <ScreenCapture.au3>

$FilePath = @DesktopDir
$FileName = 'Problem'
$FileList = _FileListToArray($FilePath, $FileName & '*.jpg', 1)

If Not IsArray($FileList) Then
    $FileName &= '1.jpg'
Else
    $FileName &= $FileList[0] + 1 & '.jpg'
EndIf

_ScreenCapture_Capture($FilePath & "\" & $FileName)


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

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