pdark1987 Posted April 1, 2015 Posted April 1, 2015 ss() Func ss() Local $hBmp ; Capture full screen $hBmp = _ScreenCapture_Capture("") ; Save bitmap to file _ScreenCapture_SaveImage(@MyDocumentsDir & "Image.jpg", $hBmp) ShellExecute(@MyDocumentsDir & "Image.jpg") EndFunc ;==>ss so the code works my problem is it override the image and i want to rather save it as image1,image2 and so on. and also im not sure how to i can add a folder to it so atm is saving in mydoucments how would i save to a new folder in doc? thanks for the help
l3ill Posted April 1, 2015 Posted April 1, 2015 Here is how to add a new folder: _ScreenCapture_SaveImage(@MyDocumentsDir & "\new_folder\Image.jpg", $hBmp) And to change the name each time I usually use one of the Time Macros. My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
l3ill Posted April 1, 2015 Posted April 1, 2015 (edited) _ScreenCapture_SaveImage(@MyDocumentsDir & "\new_folder\" @hour & @min & @sec & "Image.jpg", $hBmp) Edited April 1, 2015 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
Solution l3ill Posted April 1, 2015 Solution Posted April 1, 2015 (edited) Turns out you have to use DirCreate to add a new folder, this should work #include <ScreenCapture.au3> DirCreate(@MyDocumentsDir & "\newfolder\") ss() Func ss() Local $dTimeStamp = @HOUR & @MIN & @SEC Local $hBmp ; Capture full screen $hBmp = _ScreenCapture_Capture("") ; Save bitmap to file _ScreenCapture_SaveImage(@MyDocumentsDir & "\newfolder\" & $dTimeStamp & "Image.jpg", $hBmp) ShellExecute(@MyDocumentsDir & "\newfolder\" & $dTimeStamp & "Image.jpg") EndFunc ;==>ss Edited April 1, 2015 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
ViciousXUSMC Posted April 1, 2015 Posted April 1, 2015 (edited) I would go with how Bill has it w/ timestamps (thats how I do it) but if you want a more traditional Image1, Image2, Etc FileListToArray() would work great. https://www.autoitscript.com/autoit3/docs/libfunctions/_FileListToArray.htm My concern would be removing images and changing the count so that you end up with duplicates again so in that case I would probably put a date of sorts on my directory instead (by day) So file structure would be My Documents --> Images --> Folder w/ Date --> Image1, Image2, Image3 Etc. I created this so users could archive all the scans they get in a single folder, it uses both filelisttoarray and macros to give uniqe names so maybe it will be of help. expandcollapse popup;Needed UDFS #Include <_Zip.au3> #include <File.au3> #include <Array.au3> ;Path Varibles $ArchiveSorc = @ScriptDir $ArchiveDest = "H:\Scans Archive\" $ArchiveTmp = @MyDocumentsDir & "\DailyArchive\" ;Msgbox Confirmation 6= Yes Else Exit $Choice = MsgBox(4, "Black Magic Archive Tool", "Are you ready to archive all .PDF files from your Local Scans folder to your Archive Folder?") If $Choice = 6 Then DirCreate($ArchiveDest) ;File Move 9 = Overwrite FileMove($ArchiveSorc & "\*.pdf", $ArchiveTmp, 9) ;ZipCreate 0 Do not Overwrite $ZipNow = _Zip_Create($ArchiveDest & @MON & "-" & @MDAY & "-" & @YEAR & " Archive.zip", 0) If @Error = 1 Then $ZipNow = $ArchiveDest & @MON & "-" & @MDAY & "-" & @YEAR & " Archive.zip" ;@Error 1 = File Already Exsists ;Puts all file names into an Array $FileList = _FileListToArray($ArchiveTmp) ; Debugging See the Array Values In Window ;_ArrayDisplay($FileList) For $i = 1 To UBound($FileList) - 1 ;Debugging See the Current i and array value used in loop ;MsgBox(0, "", "Current i Value " & $i & " making current array value" & $FileList[$i]) _Zip_AddItem($ZipNow, $ArchiveTmp & $FileList[$i]) Next ;Delete Temp Folder to keep Computer HDD Clean and Purge Files FileDelete($ArchiveTmp) MsgBox(0, "Black Magic Archive Tool", _Zip_Count($ZipNow) & " Items are now in your .ZIP Archive located at " & $ArchiveDest) Exit Else Exit EndIf Edited April 1, 2015 by ViciousXUSMC
pdark1987 Posted April 3, 2015 Author Posted April 3, 2015 ok thanks guy i like bill its simple to use and im was added it already just need to add things to it thank again
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