prasad123 Posted March 29, 2018 Posted March 29, 2018 Hi All This is a small excerpt from my code. Basically I am creating a folder in My Documents. I am naming the folder using the current date and time. Then I have to save some screenshots in that folder. First I go to My Documents window. Then I do following Send("^+{n}") ;Create New Folder in My Documents using ctrl+shift+n Sleep (1000) Local $pathname = "Automation Test" & " " & " " & @MDAY & "." & @MON & "." & @YEAR & " " & " " & @HOUR & "." & @MIN & "." & @SEC ;create a string with current date and time Send ($pathname) ;name the folder with this string Sleep(1000) Send("{ENTER}") ; Folder gets successfully created and renamed. Now I have to save some screenshots. Here I am facing problem. I tried following ways but nothing is happening: _ScreenCapture_Capture(@MyDocumentsDir & $pathname & "\myscreen.jpg") _ScreenCapture_Capture(@MyDocumentsDir & $pathname "\myscreen.jpg") _ScreenCapture_Capture(@MyDocumentsDir \ $pathname "\GDI-lus_Image1.jpg") Please guide me regarding the correct way of accessing that folder. Thanking in advance
Moderators JLogan3o13 Posted March 29, 2018 Moderators Posted March 29, 2018 @prasad123 This works for me, and uses a whole lot let quotes: #include <ScreenCapture.au3> $sPath = @MyDocumentsDir & "\Automation Test " & @MDAY & "." & @MON & "." & @YEAR & " " & @HOUR & "." & @MIN & "." & @SEC If Not(FileExists($sPath)) Then DirCreate($sPath) EndIf _ScreenCapture_Capture($sPath & "\myscreen.jpg") prasad123 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
prasad123 Posted April 10, 2018 Author Posted April 10, 2018 On 3/29/2018 at 6:39 PM, JLogan3o13 said: @prasad123 This works for me, and uses a whole lot let quotes: #include <ScreenCapture.au3> $sPath = @MyDocumentsDir & "\Automation Test " & @MDAY & "." & @MON & "." & @YEAR & " " & @HOUR & "." & @MIN & "." & @SEC If Not(FileExists($sPath)) Then DirCreate($sPath) EndIf _ScreenCapture_Capture($sPath & "\myscreen.jpg") thank you so much
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