Jump to content

how can convert the file name to date name


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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 !!

Link to comment
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
Link to comment
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 ?

Link to comment
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?

Link to comment
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
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...