johngreen2000 Posted September 5, 2006 Posted September 5, 2006 I am attempting to make a script so that when pressing a hotkey a screenshot will be taken and saved to a file automatically. My plan was set up a hot key to press print screen open mspaint hidden paste to mspaint save as filexxx where xxx can either be a random number or ascending number. I believe I can do everything except figure out how to paste what I have on my clipboard to the mspaint program.
Moderators SmOke_N Posted September 5, 2006 Moderators Posted September 5, 2006 I am attempting to make a script so that when pressing a hotkey a screenshot will be taken and saved to a file automatically.My plan wasset up a hot key to press print screenopen mspaint hiddenpaste to mspaintsave as filexxx where xxx can either be a random number or ascending number.I believe I can do everything except figure out how to paste what I have on my clipboard to the mspaint program.Send('^v') doesn't work? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
johngreen2000 Posted September 5, 2006 Author Posted September 5, 2006 Send('^v') doesn't work?Well I want to have mspaint hidden using the @SW_HIDDEN command. I figured '^v' wouldnt be able to touch the process. Maybe im wrong Ill give that a shot.
trids Posted September 5, 2006 Posted September 5, 2006 If you're open to a lateral solution ..Download FastStone's Screen Capture utility (free) , which you can configure to automatically save a screenshot with a hotkey. Then all your script has to do is execute the hotkey http://www.faststone.org/HTH
Moderators SmOke_N Posted September 5, 2006 Moderators Posted September 5, 2006 You can do what Trids say, or try and use ControlSend() so it will work even if it's hidden. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
johngreen2000 Posted September 5, 2006 Author Posted September 5, 2006 You can do what Trids say, or try and use ControlSend() so it will work even if it's hidden.Thanks I am experimenting with ControlSend() right nowOne other problem. Ok just for ease I made a simple script to open mspaint, press printscreen and paste it. But I ran into saving the file. I found Filesavedialog() but I really am trying to avoid having to type the name in. I looked around some, and cant seem to find a way to give it a default name to save as and not make the dialog box come up.Thanks for both of your helps, they are pushing me in the right direction.
rambo3889 Posted September 5, 2006 Posted September 5, 2006 U could also use Lazycats dll capture screen which can be found here http://www.autoitscript.com/fileman/users/Lazycat/dlls.html or a direct download link http://www.autoitscript.com/fileman/users/Lazycat/files/captdll_v2.zipAnd use this code Local $dllopen=DllOpen("captdll.dll") Global $place=@ScriptDir&"\" HotKeySet("{F3}","take") HotKeySet("{F2}","exiter") While 1 Sleep(10) WEnd FUnc exiter() DllClose($dllopen) Exit EndFunc Func take() For $1=0 to 100000 if FileExists($place&"image"&$1&".jpg") Then ; Dont do anything Else DllCall($dllopen, "int", "CaptureScreen", "str", "image"&$1&".jpg", "int", 85) ExitLoop EndIf Next EndFunc My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight!
Confuzzled Posted September 5, 2006 Posted September 5, 2006 You could always make the file name unique by using the timestamp as part of the name. eg: ScreenShotYYYYMMDDHHMMSS.jpg
raedts Posted September 5, 2006 Posted September 5, 2006 Why reinvent the wheel?http://www.faststone.org/
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