SalamanderSoup Posted August 19, 2016 Posted August 19, 2016 I've created a simple script that opens the Snipping Tool; Selects the "Full Screen Snip" option; then closes the program, prompting a save. What I can't figure is how to name the file using the system date and time. Can anyone help? Run(@WindowsDir & '\system32\SnippingTool.exe') AutoItSetOption('MouseCoordMode', 0) Sleep(1) $hWnd= WinWait("Snipping Tool", "ToolBarWindow32", 1) WinActive($hWnd) MouseClick('primary', 84, 48, 1, 0) MouseClick('primary', 84, 140, 1, 0) WinClose("[Class:Microsoft-Windows-Tablet-SnipperEditor]") ControlClick("Snipping Tool", "", "Button1")
Moderators JLogan3o13 Posted August 19, 2016 Moderators Posted August 19, 2016 @SalamanderSoup moved your topic to General Help and Support, as you seemed to have missed this at the top of the Examples forum: Do not post general support questions here, instead use the AutoIt Help and Support forums. "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!
SalamanderSoup Posted August 22, 2016 Author Posted August 22, 2016 Thanks, I hope someone will be able to help me.
l3ill Posted August 22, 2016 Posted August 22, 2016 (edited) Probably because windows wont allow you to save a file with back slashes/forward slashes\ in it. Try using _NowDate() and StringReplace and replace the " / \ " with "." for instance... p.s. unless you are dead set on using SnippetTool, Autoit has a very cool function called: _ScreenCapture_Capture that does this job very well Edited August 22, 2016 by l3ill p.s. SalamanderSoup and Xandy 2 My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
SalamanderSoup Posted August 22, 2016 Author Posted August 22, 2016 Thanks l3ill, could you possibly give me an example of how the NowDate and StringReplace scripts might look together? I've looked at the AutoScript Help File, and still feel a bit confused at how I should code it. I'm very new at this. 3 hours ago, l3ill said: Probably because windows wont allow you to save a file with back slashes/forward slashes\ in it. Try using _NowDate() and StringReplace and replace the " / \ " with "." for instance... p.s. unless you are dead set on using SnippetTool, Autoit has a very cool function called: _ScreenCapture_Capture that does this job very well
Xandy Posted August 22, 2016 Posted August 22, 2016 (edited) Here is your script. #include <Date.au3> #include <ScreenCapture.au3> $filename = _NowDate() ; String Find Replace $filename = StringReplace($filename, "/", ".") ; I'm guessing fixed location wants the cursor off ; Filepath \ Filename .Type x1 y1 x2 y2 Capture Mouse Cursor _ScreenCapture_Capture(@ScriptDir & "\" & $filename & ".png", 84, 48, 84, 140, False) It's only programmed to read 1 pixel width, but I hope you know that already. If you want a BMP or something else you can change the type ".png" Edited August 23, 2016 by Xandy SalamanderSoup 1 Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker)
l3ill Posted August 23, 2016 Posted August 23, 2016 Nice follow up Xandy... I hope this is not going to be too expensive Xandy 1 My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
SalamanderSoup Posted August 23, 2016 Author Posted August 23, 2016 Lol, I'd buy that script for a dollar! Thank you, both for the input, and thank you Xandy for the working script. I was able to add the system time to the file name, as well. Xandy 1
Xandy Posted August 23, 2016 Posted August 23, 2016 4 hours ago, l3ill said: Nice follow up Xandy... I hope this is not going to be too expensive I try SO hard! Your advice gave me a concise path to victory. 2 hours ago, SalamanderSoup said: I was able to add the system time to the file name, as well. Then you're learning and all is well. There's nothing wrong with eating a free fish, unless you're the fish. Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker)
AutoBert Posted August 24, 2016 Posted August 24, 2016 15 hours ago, SalamanderSoup said: Lol, I'd buy that script for a dollar! Just put a one dollar note in your cdtray and run FileCopy('path to cdtray\one dollar.$$$','https://www.autoitscript.com/donate') The dollar will transfered asap. mLipok 1
l3ill Posted August 24, 2016 Posted August 24, 2016 LOL two things that are, in this day and age, equally worthless: CD Tray and a Dollar.... My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
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