powermaster Posted June 11, 2012 Share Posted June 11, 2012 Hi. I can\t make my script do 2 things at same time: <p>#include <ScreenCapture.au3>;</p><p><br></p><p><div>Local $hWnd = "test1>"</div><div>For $i = 1 To 10</div><div>_ScreenCapture_SetJPGQuality(30)</div><div> _ScreenCapture_CaptureWnd($i & ".jpg", $hWnd)</div><div> Sleep(500)</div><div>Next</div><div><br></div><div><div>Local $hWnd = "test2>"</div><div>For $i = 1 To 10</div><div>_ScreenCapture_SetJPGQuality(30)</div><div> _ScreenCapture_CaptureWnd($i & ".gif", $hWnd)</div><div> Sleep(500)</div><div>Next</div></div></p> It wil start taking 10 screenshots : .jpg and then it will takes 10 screenshots : .gif I need it to be setup this way, I don\t want the 2 codes to be together in one, how is it possible to make it take the screenshot at same time Link to comment Share on other sites More sharing options...
Kidney Posted June 11, 2012 Share Posted June 11, 2012 make 2 different scripts and have both of them run when you press a hot key Link to comment Share on other sites More sharing options...
PhoenixXL Posted June 11, 2012 Share Posted June 11, 2012 (edited) try registering two Functions using AdlibregisterCode:AdlibRegister('_Write') AdlibRegister('_WriteAgain') While 1 Sleep(200) WEnd Func _Write() ConsoleWrite('Func 1'&@CRLF) EndFunc Func _WriteAgain() ConsoleWrite('Func 2'&@CRLF) EndFuncTherewill be ofcourse a bit of difference in execution with respect to timebut overall it wont affect Edited June 11, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
powermaster Posted June 11, 2012 Author Share Posted June 11, 2012 thanks alot Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 11, 2012 Moderators Share Posted June 11, 2012 (edited) powermaster,Just put the 2 captures in the same loop:#include <screencapture.au3> _ScreenCapture_SetJPGQuality(30) For $i = 1 To 10 _ScreenCapture_CaptureWnd($i & ".jpg", "test1>") _ScreenCapture_CaptureWnd($i & ".gif", "test2>") Sleep(500) NextAs AutoIt cannot do 2 things at once, this is probably as close as you can get to simultaneous. Running 2 scripts as suggested above is, in my experience, likely to be even more unsynchronised - and Adlib is not the answer here. M23 Edited June 11, 2012 by Melba23 Typo Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Exit Posted June 11, 2012 Share Posted June 11, 2012 do screenshot to .gif and then convert gif to jpg App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
powermaster Posted June 11, 2012 Author Share Posted June 11, 2012 hi melba thanks you solution, anorther one would be to have: 1.au3 2.au3 and then shellexecute 1.au3 and 2.au3, but i guess thats a kinda slutty solution if i did that ? Link to comment Share on other sites More sharing options...
JohnQSmith Posted June 11, 2012 Share Posted June 11, 2012 and then shellexecute 1.au3 and 2.au3You still can't be sure that that two scripts will be snagging screenshots at the same time. The OS will start one script then the other script and then depending on interrupts and dll calls and wait states and disk access and all sorts of other background things, script 1 could actually finish before script 2 even fires off its first capture or the other way around. The suggestions from Melba23 and forumer100 would be your best choices. Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes". Link to comment Share on other sites More sharing options...
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