Jump to content

guestscripter

Active Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by guestscripter

  1. I have been making an effort to keep my scripts as readable as I can, especially since it became clear to me how it otherwise becomes very tricky to maintain a longer script, and extensive use of Regions has been a bigger part of that. SciTE4Autoit3 is great at highlighting different parts of code and so on, and I make heavy usage of the "Tidy" function, which saves a lot of time when it comes to Indentation inside Functions and (also nested) If...EndIf, While...Wend and similar statements. What it seems not intended to do (by default?), is to also apply Indentation within #Region...#EndRegion markings - which is what I would like it to do now. Whenever I do this myself, and then "Tidy" my code, this is undone. Maybe there is a setting somewhere, or a workaround? I´ve only found the "Options"-->"Change Indentation Settings" Menu where Tab Size and Indent Size can be set...
  2. try, instead of WinGetHandle("[ACTIVE]") to use $sWinTitle = "yourwindowtitle" ;... $hWinHandle = WinGetHandle($sWinTitle) because as far as is understandable, you don´t want the script to bring to focus any windows, which means you don´t want the script to activate any windows. So stop activating windows in your script with WinActivate :-)
  3. Here´s a snippet from a working function I have that uses StringRegExp on a string with several lines #Region Qualify If Not StringRegExp($sSource, '\*\*\*.*\*\*\*\r\n.*\r\n\d+ [A-Z]*/EINH\.: \d*\r\n(?>INCENTIVE\(I\): 004=003;\r\n)*(?>\d+ NEU [A-Z, -]+ (?>M|F) \d+ \d+ \d{2}.\d{2}-\d{2}.\d{2} .*?\r\n)+', 0) Then Return False #EndRegion Qualify Notice the \r\n which is Return+Linefeed i.e. equal to CR+LF i.e. @CRLF. And to look for a variable amount of lines in something, I´ve used a "non-capturing group" like (simplified example) .*(?>.*rn)*. ...so try, if say your string is: stuff in line 1 stuff in line 2 line 3 stuff more stuff (line 4) fifth line WE HAVE A NEW LINE the pattern (with $flag = 3) .+(?>\r\n)* would return an array with: 0 => stuff in line 1 1 => stuff in line 2 2 => line 3 stuff 3 => more stuff (line 4) 4 => fifth line 5 => WE HAVE A NEW LINE P.S. I very firmly suggest, if you don´t yet, the use of the "StringRegExpGUI" (found in the helpfile, and/or the AutoIt Includes folder)
  4. Just my humble 2 cents to the UDF in general: For the sake of habits, the syntax function could be more similar to the native MsgBox function, so that when used without customisations, ExtMsgBox($MB_SYSTEMMODAL, "Title", "This message box will timeout after 10 seconds or select the OK button.", 10) would look and work the same as MsgBox($MB_SYSTEMMODAL, "Title", "This message box will timeout after 10 seconds or select the OK button.", 10) ; (taken from the Helpfile as an example) and then basically everything in a script that uses "MsgBox" could be (very simply with Search&Replace) replaced with "ExtMsgBox", initially without any real effect - until then usage of more detailed parameters is applied...
  5. Reading and learning from your code now. As you may have seen I was having a proper go at it myself, and (earlier than expected) came to some result myself. In any case I still very much appreciate your time since I can compare and learn from how somebody with more experience goes about it. And Yes, it´s working superbly. :-)
  6. Thanks a lot for sharing this. Also for me it will be used well. I´ve initially come across this looking for a way to apply the _MouseTrap() UDF function to a MessageBox - which I suppose is not possible with standard windows MsgBox´s, as with these there is no opportunity between creation and dissapearance to fetch the coordinates and apply _MouseTrap(ping)... ...unless using two scripts... So anyway, could I perhaps ask for advice on this? Would I modify the UDF for myself to WinGetPos right after the GUICreate, and then activate the MouseTrap? Has anybody else done something similar before already? So that the user can even move/drag the ExtMsgBox window around the screen - just not click anything outside it accidentally? Edit: to elaborate just a little more: the app I would like to use your UDF for uses lots of ControlSend (just to a Window, because that window has very "funny" controls), and so that window needs to be kept active and the mouse and keyboard need to be disabled while it is working, otherwise unwanted things would happen if something is pressed/clicked/activated. During the process there are two or three querys for the user, where Option A or B or C is to selected. (the Timeout countdown thing in your UDF is wonderfull btw!). I would like the user to be able to select an option, or to abort the script, at this point - but not do anything else that would disrupt something. Therefore now the intention to somehow combine your ExtMsgBox with BlockInputEx and MouseTrap... ReEdit: thinking through the question helped get me get an answer myself. Here´s how I customised it: Func _ExtMsgBox($vIcon, $vButton, $sTitle, $sText, $iTimeOut = 0, $hWin = "", $iVPos = 0, $bMouseTrapToWin = FALSE) If $bMouseTrapToWin Then #include-once #include <Misc.au3>; for MouseTrap EndIf ; Set default sizes for message box Local $iMsg_Width_Max = $g_aEMB_Settings[6], $iMsg_Width_Min = 150, $iMsg_Width_Abs = $g_aEMB_Settings[7] Local $iMsg_Height_Min = 100 Local $iButton_Width_Def = 80, $iButton_Width_Min = 50 ; Declare local variables Local $iParent_Win = 0, $fCountdown = False, $cCheckbox, $aLabel_Size, $aRet, $iRet_Value, $iHpos Local $sButton_Text, $iButton_Width_Req, $iButton_Width, $iButton_Xpos ; Validate timeout value $iTimeOut = Int(Number($iTimeOut)) ; Set automatic timeout if no buttons and no timeout set If $vButton == " " And $iTimeOut = 0 Then $iTimeOut = 5 EndIf ; Check for icon Local $iIcon_Style = 0 Local $iIcon_Reduction = 50 Local $sDLL = "user32.dll" If StringIsDigit($vIcon) Then Switch $vIcon Case 0 $iIcon_Reduction = 0 Case 8 $sDLL = "imageres.dll" $iIcon_Style = 78 Case 16 ; Stop $iIcon_Style = -4 Case 32 ; Query $iIcon_Style = -3 Case 48 ; Exclam $iIcon_Style = -2 Case 64 ; Info $iIcon_Style = -5 Case 128 ; Countdown If $iTimeOut > 0 Then $fCountdown = True Else ContinueCase EndIf Case Else Return SetError(1, 0, -1) EndSwitch Else $sDLL = $vIcon $iIcon_Style = 0 EndIf ; Check if two buttons are seeking focus StringRegExpReplace($vButton, "((?<!&)&)(?!&)", "*") If @extended > 1 Then Return SetError(2, 0, -1) EndIf ; Check if using constants or text If IsNumber($vButton) Then Switch $vButton Case 0 $vButton = "OK" Case 1 $vButton = "&OK|Cancel" Case 2 $vButton = "&Abort|Retry|Ignore" Case 3 $vButton = "&Yes|No|Cancel" Case 4 $vButton = "&Yes|No" Case 5 $vButton = "&Retry|Cancel" Case 6 $vButton = "&Cancel|Try Again|Continue" Case Else Return SetError(3, 0, -1) EndSwitch EndIf ; Get required button size If $vButton <> " " Then ; Split button text into individual strings Local $aButton_Text = StringSplit($vButton, "|") ; Get absolute available width for each button Local $iButton_Width_Abs = Floor((($iMsg_Width_Max - 10) / $aButton_Text[0]) - 10) ; Error if below min button size If $iButton_Width_Abs < $iButton_Width_Min Then Return SetError(4, 0, -1) EndIf ; Determine required size of buttons to fit text Local $iButton_Width_Text = 0 ; Loop through button text For $i = 1 To $aButton_Text[0] ; Remove a possible leading & $sButton_Text = StringRegExpReplace($aButton_Text[$i], "^&?(.*)$", "$1") ; Check on font to use If BitAND($g_aEMB_Settings[0], 4) Then $aRet = _StringSize($sButton_Text, $g_aEMB_Settings[10], Default, Default, $g_aEMB_Settings[11]) Else $aRet = _StringSize($sButton_Text, $g_aEMB_Settings[4], Default, Default, $g_aEMB_Settings[5]) EndIf If IsArray($aRet) And $aRet[2] + 10 > $iButton_Width_Text Then ; Find max button width required for text $iButton_Width_Text = $aRet[2] + 10 EndIf Next ; Error if text would make required button width > absolute available If $iButton_Width_Text > $iButton_Width_Abs Then Return SetError(5, 0, -1) EndIf ; Determine button size to use - assume default $iButton_Width = $iButton_Width_Def ; If text requires wider then default If $iButton_Width_Text > $iButton_Width_Def Then ; Increase - cannot be > absolute $iButton_Width = $iButton_Width_Text EndIf ; If absolute < default If $iButton_Width_Abs < $iButton_Width_Def Then ; If text > min (text must be < abs) If $iButton_Width_Text > $iButton_Width_Min Then ; Set text width $iButton_Width = $iButton_Width_Text Else ; Set min width $iButton_Width = $iButton_Width_Min EndIf EndIf ; Determine GUI width required for all buttons at this width $iButton_Width_Req = (($iButton_Width + 10) * $aButton_Text[0]) + 10 Else $iButton_Width_Req = 0 EndIf ; Set tab expansion flag if required Local $iExpTab = Default If BitAND($g_aEMB_Settings[0], 8) Then $iExpTab = 1 EndIf ; Get message label size While 1 Local $aLabel_Pos = _StringSize($sText, $g_aEMB_Settings[4], Default, $iExpTab, $g_aEMB_Settings[5], $iMsg_Width_Max - 20 - $iIcon_Reduction) If @error Then If $iMsg_Width_Max >= $iMsg_Width_Abs Then Return SetError(6, 0, -1) Else $iMsg_Width_Max += 10 EndIf Else ExitLoop EndIf WEnd ; Reset text to wrapped version $sText = $aLabel_Pos[0] ; Set label size Local $iLabel_Width = $aLabel_Pos[2] Local $iLabel_Height = $aLabel_Pos[3] ; Set GUI size Local $iMsg_Width = $iLabel_Width + 20 + $iIcon_Reduction ; Increase width to fit buttons if needed If $iButton_Width_Req > $iMsg_Width Then $iMsg_Width = $iButton_Width_Req If $iMsg_Width < $iMsg_Width_Min Then $iMsg_Width = $iMsg_Width_Min $iLabel_Width = $iMsg_Width_Min - 20 EndIf Local $iMsg_Height = $iLabel_Height + 35 ; Increase height if buttons present If $vButton <> " " Then $iMsg_Height += 30 EndIf ; Increase height if checkbox required If BitAND($g_aEMB_Settings[0], 16) Then $iMsg_Height += 40 EndIf If $iMsg_Height < $iMsg_Height_Min Then $iMsg_Height = $iMsg_Height_Min ; If only single line, lower label to to centre text on icon Local $iLabel_Vert = 20 If StringInStr($sText, @CRLF) = 0 Then $iLabel_Vert = 27 ; Check for taskbar button style required If Mod($g_aEMB_Settings[0], 2) = 1 Then ; Hide taskbar button so create as child If IsHWnd($hWin) Then $iParent_Win = $hWin ; Make child of that window Else $iParent_Win = WinGetHandle(AutoItWinGetTitle()) ; Make child of AutoIt window EndIf EndIf ; Determine EMB location If $hWin = "" Then ; No handle or position passed so centre on screen $iHpos = (@DesktopWidth - $iMsg_Width) / 2 $iVPos = (@DesktopHeight - $iMsg_Height) / 2 Else If IsHWnd($hWin) Then ; Get parent GUI pos if visible If BitAND(WinGetState($hWin), 2) Then ; Set EMB to centre on parent Local $aPos = WinGetPos($hWin) $iHpos = ($aPos[2] - $iMsg_Width) / 2 + $aPos[0] - 3 $iVPos = ($aPos[3] - $iMsg_Height) / 2 + $aPos[1] - 20 Else ; Set EMB to centre om screen $iHpos = (@DesktopWidth - $iMsg_Width) / 2 $iVPos = (@DesktopHeight - $iMsg_Height) / 2 EndIf Else ; Assume parameter is horizontal coord $iHpos = $hWin ; $iVpos already set EndIf EndIf ; Now check to make sure GUI is visible on screen ; First horizontally If $iHpos < 10 Then $iHpos = 10 If $iHpos + $iMsg_Width > @DesktopWidth - 20 Then $iHpos = @DesktopWidth - 20 - $iMsg_Width ; Then vertically If $iVPos < 10 Then $iVPos = 10 If $iVPos + $iMsg_Height > @DesktopHeight - 60 Then $iVPos = @DesktopHeight - 60 - $iMsg_Height ; Remove TOPMOST extended style if required Local $iExtStyle = 0x00000008 ; $WS_TOPMOST If BitAND($g_aEMB_Settings[0], 2) Then $iExtStyle = -1 ; Create GUI with $WS_POPUPWINDOW, $WS_CAPTION style and required extended style Local $hMsgGUI = GUICreate($sTitle, $iMsg_Width, $iMsg_Height, $iHpos, $iVPos, BitOR(0x80880000, 0x00C00000), $iExtStyle, $iParent_Win) If @error Then Return SetError(7, 0, -1) EndIf ; Check if titlebar icon hidden - actually uses transparent icon from AutoIt executable If BitAND($g_aEMB_Settings[0], 32) Then If @Compiled Then GUISetIcon(@ScriptName, -2, $hMsgGUI) Else GUISetIcon(@AutoItExe, -2, $hMsgGUI) EndIf EndIf If $g_aEMB_Settings[2] <> Default Then GUISetBkColor($g_aEMB_Settings[2]) ; Check if user closure permitted If BitAND($g_aEMB_Settings[0], 64) Then $aRet = DllCall("User32.dll", "hwnd", "GetSystemMenu", "hwnd", $hMsgGUI, "int", 0) Local $hSysMenu = $aRet[0] DllCall("User32.dll", "int", "RemoveMenu", "hwnd", $hSysMenu, "int", 0xF060, "int", 0) ; $SC_CLOSE DllCall("User32.dll", "int", "DrawMenuBar", "hwnd", $hMsgGUI) EndIf ; Set centring parameter Local $iLabel_Style = 0 ; $SS_LEFT If BitAND($g_aEMB_Settings[1], 1) = 1 Then $iLabel_Style = 1 ; $SS_CENTER ElseIf BitAND($g_aEMB_Settings[1], 2) = 2 Then $iLabel_Style = 2 ; $SS_RIGHT EndIf ; Create label GUICtrlCreateLabel($sText, 10 + $iIcon_Reduction, $iLabel_Vert, $iLabel_Width, $iLabel_Height, $iLabel_Style) GUICtrlSetFont(-1, $g_aEMB_Settings[4], Default, Default, $g_aEMB_Settings[5]) If $g_aEMB_Settings[3] <> Default Then GUICtrlSetColor(-1, $g_aEMB_Settings[3]) ; Create checkbox if required If BitAND($g_aEMB_Settings[0], 16) Then Local $sAgain = " Do not show again" Local $iY = $iLabel_Vert + $iLabel_Height + 10 ; Create checkbox $cCheckbox = GUICtrlCreateCheckbox("", 10 + $iIcon_Reduction, $iY, 20, 20) ; Write text in separate checkbox label Local $cCheckLabel = GUICtrlCreateLabel($sAgain, 20, 20, 20, 20) GUICtrlSetColor($cCheckLabel, $g_aEMB_Settings[3]) GUICtrlSetBkColor($cCheckLabel, $g_aEMB_Settings[2]) ; Set font if required and size checkbox label text If BitAND($g_aEMB_Settings[0], 4) Then $aLabel_Size = _StringSize($sAgain) Else $aLabel_Size = _StringSize($sAgain, $g_aEMB_Settings[4], 400, 0, $g_aEMB_Settings[5]) GUICtrlSetFont($cCheckLabel, $g_aEMB_Settings[4], 400, 0, $g_aEMB_Settings[5]) EndIf ; Move and resize checkbox label to fit $iY = ($iY + 10) - ($aLabel_Size[3] - 4) / 2 ControlMove($hMsgGUI, "", $cCheckLabel, 30 + $iIcon_Reduction, $iY, $iMsg_Width - (30 + $iIcon_Reduction), $aLabel_Size[3]) EndIf ; Create icon or countdown timer If $fCountdown = True Then Local $cCountdown_Label = GUICtrlCreateLabel(StringFormat("%2s", $iTimeOut), 10, 20, 32, 32) GUICtrlSetFont(-1, 18, Default, Default, $g_aEMB_Settings[5]) GUICtrlSetColor(-1, $g_aEMB_Settings[3]) Else If $iIcon_Reduction Then GUICtrlCreateIcon($sDLL, $iIcon_Style, 10, 20) EndIf ; Create buttons Local $cAccel_Key = 9999 ; Placeholder to prevent firing if no buttons If $vButton <> " " Then ; Create dummy control for Accel key $cAccel_Key = GUICtrlCreateDummy() ; Set Space key as Accel key Local $aAccel_Key[1][2] = [["{SPACE}", $cAccel_Key]] GUISetAccelerators($aAccel_Key) ; Calculate button horizontal start If $aButton_Text[0] = 1 Then If BitAND($g_aEMB_Settings[1], 4) = 4 Then ; Single centred button $iButton_Xpos = ($iMsg_Width - $iButton_Width) / 2 Else ; Single offset button $iButton_Xpos = $iMsg_Width - $iButton_Width - 10 EndIf Else ; Multiple centred buttons $iButton_Xpos = ($iMsg_Width - ($iButton_Width_Req - 20)) / 2 EndIf ; Set default button code Local $iDefButton_Code = 0 ; Set default button style Local $iDef_Button_Style = 0 ; Work through button list For $i = 0 To $aButton_Text[0] - 1 Local $iButton_Text = $aButton_Text[$i + 1] ; Set default button If $aButton_Text[0] = 1 Then ; Only 1 button $iDef_Button_Style = 0x0001 ElseIf StringLeft($iButton_Text, 1) = "&" Then ; Look for & $iDef_Button_Style = 0x0001 $aButton_Text[$i + 1] = StringTrimLeft($iButton_Text, 1) ; Set default button code for Accel key return $iDefButton_Code = $i + 1 EndIf ; Draw button GUICtrlCreateButton($aButton_Text[$i + 1], $iButton_Xpos + ($i * ($iButton_Width + 10)), $iMsg_Height - 35, $iButton_Width, 25, $iDef_Button_Style) ; Set font if required If Not BitAND($g_aEMB_Settings[0], 4) Then GUICtrlSetFont(-1, $g_aEMB_Settings[4], 400, 0, $g_aEMB_Settings[5]) ; Reset default style parameter $iDef_Button_Style = 0 Next EndIf If $bMouseTrapToWin Then $aWinPos = WinGetPos($hMsgGUI) _MouseTrap($aWinPos[0],$aWinPos[1],$aWinPos[0]+$aWinPos[2],$aWinPos[1]+$aWinPos[3]) EndIf ; Show GUI GUISetState(@SW_SHOW, $hMsgGUI) ; Begin timeout counter Local $iTimeout_Begin = TimerInit() Local $iCounter = 0 ; Declare GUIGetMsg return array here and not in loop Local $aMsg ; Set MessageLoop mode Local $iOrgMode = Opt('GUIOnEventMode', 0) While 1 $aMsg = GUIGetMsg(1) If $aMsg[1] = $hMsgGUI Then Select Case $aMsg[0] = -3 ; $GUI_EVENT_CLOSE $iRet_Value = 0 ExitLoop Case $aMsg[0] = $cAccel_Key ; Accel key pressed so return default button code If $iDefButton_Code Then $iRet_Value = $iDefButton_Code ExitLoop EndIf Case $aMsg[0] > $cAccel_Key ; Button handle minus Accel key handle will give button index $iRet_Value = $aMsg[0] - $cAccel_Key ExitLoop EndSelect EndIf ; Timeout if required If TimerDiff($iTimeout_Begin) / 1000 >= $iTimeOut And $iTimeOut > 0 Then $iRet_Value = 9 ExitLoop EndIf ; Show countdown if required If $fCountdown = True Then Local $iTimeRun = Int(TimerDiff($iTimeout_Begin) / 1000) If $iTimeRun <> $iCounter Then $iCounter = $iTimeRun GUICtrlSetData($cCountdown_Label, StringFormat("%2s", $iTimeOut - $iCounter)) EndIf EndIf If $bMouseTrapToWin Then $aWinPos = WinGetPos($hMsgGUI) _MouseTrap($aWinPos[0],$aWinPos[1],$aWinPos[0]+$aWinPos[2],$aWinPos[1]+$aWinPos[3]) EndIf WEnd ; Reset original mode Opt('GUIOnEventMode', $iOrgMode) If GUICtrlRead($cCheckbox) = 1 Then ; Negate the return value $iRet_Value *= -1 EndIf GUIDelete($hMsgGUI) If $bMouseTrapToWin Then _MouseTrap() EndIf Return $iRet_Value EndFunc ;==>_ExtMsgBox (this isn´t standalone code - it works when overwriting the _ExtMsgBox function in a copy of the UDF) For me it even works if the ExtMsgBox is dragged around, since I tried "re-trapping" the mouse with every GUIGetMsg cycle, although this is maybe a performance factor. Now I guess I can do what I wanted like this, combined with unblocking (with BlockInputEx) mouse-movement and mouse-clicking before the user query, and reblocking that after. If this is at all usefull to anybode then of course all credit still goes fully to Melba23. I´d be delighted if this optional parameter would even be integrated into the "official" UDF. Also of course I´m still open to hearing of a better way to do this.
  7. OK, well that´s a fair enough answer. Thanks.
  8. Thank you. I´ve improved the readability of my post. The clearer I get about the answer, the more clearer the question becomes, and in the beginning it was very unclear :-) I´ve been to the page before that you recommended with the link, thanks anyway. Just please help me one more bit forwards: to get to the point where I´m able to look at the retrieved data. I understand that _ClipBoard_SetDataEx returns a handle. How do you retrieve data (binary?) from such a Clipboard handle. And then I would use BinaryToString()? of course I´ve tried to research myself. And there is this one example in the helpfile: ; Read clipboard text $hMemory = _ClipBoard_GetDataEx($CF_TEXT) If $hMemory = 0 Then _WinAPI_ShowError("_ClipBoard_GetDataEx failed") $tData = DllStructCreate("char Text[8192]", $hMemory) MemoWrite(DllStructGetData($tData, "Text")) however I suppose the part _ClipBoard_GetDataEx($CF_TEXT) needs to be changed to the correct format, and DllStructCreate("char Text[8192]"... looks like it is specific to Text, this would be my very first time working in any way with DllStructCreat..
  9. I´m thinking along the lines now of turning off the loading (not just the showing) of images (and maybe javascript) to speed up loading, and/or some kind of working function that stops loading the page when *enough* (in terms of html content I guess) of the page has been loaded. Any ideas? P.S. I imagine I can use some kind of combination of _IEAction($oIE,"stop"); which I wasn´t before, which is maybe why there was trouble with interacting with the page... and _IEPropertyGet($oIE,"outerhtml"); with perhaps IsString() and/or StringLen() and/or StringInStr() and _IEPropertyGet($oIE,"readystate"); maybe someone can give more insight into the possible return values P.P.S. I suppose it might help to look into the IE.au3 UDF IELoadWait() functions code and see how it works in the backgroudn, then try to customise it... Feel free anybody to put me on a better track :-)
  10. Well done with taking a look at the source already to find your element names the "signin[username]" and "signin[password]" already. I see though that you didn´t change the form name from my example, which I now see was probably because there isn´t one. <form id="login_form" class="biginsform" action="/https/www.autoitscript.com/auth/signin" method="post"> <input type="text" name="signin[username]" class="shadow_input biginput lightgray" title="[email protected]" id="signin_username"> <input type="password" name="signin[password]" class="shadow_input biginput" title="Type your password" id="signin_password"> <a id="submit_btn" href="#x" class="btn btn_smaller btn_orange inline_block btn_submit_form">Login »</a> </form> The good news is that there are workarounds to getting objects by names. In this case for example using the ID. Replace $oForm = _IEFormGetObjByName($g_oIE, "signup") With $oForm = _IEGetObjById($g_oIE, "login_form") and do some reading in the helpfile about all the different IE functions, and then even more reading here: http://msdn.microsoft.com/en-us/library/hh772960(v=vs.85).aspx before asking for more work to be done for you :-)
  11. Yes, while I was testing "alternative possibilities", I disabled those.
  12. To save time in scripts that are heavier with IE.au3, has anybody tried to not wait for entire pages to load and instead just wait for "enough" of the page to be loaded before continueing the script? I´ve tried things like this now, to no success yet: Func _CustomIELoadWait($sStringToWaitFor = "</form") For $iCounter = 1 To 20 $html = _IEPropertyGet($g_oIE, "innerhtml") If StringInStr($html, $sStringToWaitFor) And (_IEPropertyGet($g_oIE, "readystate") = 3 Or _IEPropertyGet($g_oIE, "readystate") = 4) Then Return Sleep(100) Next EndFunc ;==>_CustomIELoadWait It actually takes longer this way than with IELoadWait. Hmm?
  13. Look into the source code of the page: For the below example I found (not all in the same spot): <input class="portlet_login_field" type="Text" name="userid" value="" size="28" maxlength="80" tabindex="777"> <input class="portlet_login_field" type="Password" name="password" value="" size="28" maxlength="40" tabindex="778"> <input class="portlet_login_button" type="Submit" name="submit" tabindex="779" value=" Login " border="0" valign="top"> So I find out from that that the Form´s name is "signup", the Usename Input Element is called "userid" the Password Input Element is called "password" and the Submit button is called "submit". For your website check this yourself, and update the below. $g_oIE = _IECreate("http://tweepi.com/auth/login") $sYourUserName = GUICtrlRead($Input) $sYourPassword = GUICtrlRead($Input2) $oForm = _IEFormGetObjByName($g_oIE, "signup") $oFormElement = _IEFormElementGetObjByName($oForm, "userid") _IEFormElementSetValue($oFormElement, $sYourUserName) $oFormElement = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oFormElement, $sYourPassword) $oFormElement = _IEFormElementGetObjByName($oForm, "submit") _IEAction($oFormElement, "click") _IELoadWait($g_oIE)
  14. 10,000 20,000 lines? maybe someday my stomach would have the tolerance for that amount of spaghetti :-) Yeah that sounds like a great idea with some spaces, and some smaller functions. That and the above #includes trick will I think, when I´ve used them, make things look a lot clearer. Maybe I´ll also get out some paper and map out where all my variables and functions are coming from and going to somehow... unless there´s already an app that "visualises" an autoit script in 3-D or something somewhere :-D. Anyway thanks so much guys! I´ll get back if I somehow need more support when I´ve done the dirty work!
  15. I took a look at this and that´s something I can very much think to do. The explanations and examples in the post are great.
  16. Thank you guys for the advice so far! And I agree using regions is (in this case has been already) very helpful. In regards to posting the current script: here goes nothing: This is the "header" part, and the "main loop": #Region Options and Includes Opt("SendKeyDelay", 32);16 ;5 milliseconds Opt("SendKeyDownDelay", 2) ;1 millisecond Opt("WinWaitDelay", 50) ;250 milliseconds Opt("PixelCoordMode", 0) ;1=absolute, 0=relative, 2=client Opt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=client Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase #include <IE.au3> #include <Misc.au3> #include <String.au3> #include <Array.au3> #include <MsgBoxConstants.au3> ;#include <ScreenCapture.au3> #EndRegion Options and Includes #Region Declare Descriptors, Tags and Initialise Reservations Array. Declare Global Variables and Constants. #Region Descriptors $ixINDEX Global Const $ixINDEX[] = ["TaRecLoc", _ "Name", "1stName", "Title", _ "AccNm", "Acc1stN", "AccTtl", _ "Street", "City", "Postcode", "Country", _ "Email", "Phone", _ "Agent", "Company", "Group", _ "c/i DD", "c/i MM", "c/i YYYY", _ "c/o DD", "c/o MM", "c/o YYYY", _ "Adults", "Children", "Rooms", _ "RmType", "RCode", "Extras", _ "ResType", "Market", "Source", "Origin", _ "Payment", "CC#", "expMM", "expYYYY", _ "Cmmnt"] #EndRegion Descriptors $ixINDEX #Region Enumerate Tags, Initialise Array Global Enum $ixReservationCode, _;0 $ixGuestSurName, $ixGuestFirstName, $ixGuestTitle, _;1,2,3 $ixAccompGuestSurName, $ixAccompGuestFirstName, $ixAccompGuestTitle, _;4,5,6 $ixGuestAddressStreet, $ixGuestAddressCity, $ixGuestAddressPostcode, $ixGuestAddressCountryCode, _;7,8,9,10 $ixGuestEmail, $ixGuestPhone, _;11,12,13 $ixAgent, $ixCompany, $ixGroup, _;14,15,16 $ixCheckInDay, $ixCheckInMonth, $ixCheckInYear, _;17,18,19 $ixCheckoutDay, $ixCheckoutMonth, $ixCheckoutYear, _;20,21,22 $ixNumPersons, $ixNumChildren, $ixNumRooms, _;23,24,25 $ixRoomType, $ixRateCode, $ixAddonPackages, _;26,27,28 $ixResType, $ixResMarket, $ixResSource, $ixResOrigin, _;29,30,31 $ixPaymentType, $ixCreditCardNumber, $ixCreditCardExpiryMonth, $ixCreditCardExpiryYear, _;32,33,34,35 $ixReservationComment, _;36 $ix;37 Global $aReservations[0][$ix] ;Sets/resets the Array #EndRegion Enumerate Tags, Initialise Array #Region Global Variables #Region Strings Global $sOperaWinTitle = "#blablabla#" #EndRegion Strings #Region PixelChecksum Data Global $aCS_Misc_AllBlue[5] = [1798928452, 140, 155, 1002, 748] Global $aCS_Misc_FensterSelectBlue[5] = [3494973848, 9, 31, 67, 35] Global $aCS_Window_NewReservation[5] = [3176789548, 204, 191, 532, 315];or 3708915432 depending on cursor blink Global $aCS_Misc_InFocusReservation[5] = [376151908, 205, 192, 319, 212] Global $aCS_Misc_ProfileSearchNoResultSelected[5] = [2580066430, 202, 179, 213, 375];was:[1985600853, 202, 305, 229, 478] Global $aCS_Misc_ProfileSearchInProgress[5] = [1713801695, 455, 164, 957, 360] Global $aCS_Misc_ProfileSearchWithFirstResultSelected[5] = [916195880, 202, 305, 229, 478] Global $aCS_Win_IndividualProfilInFocus[5] = [4013487749, 203, 201, 341, 240] Global $aCS_Pop_Warn_NegotiatedRate[5] = [3663865623, 330, 358, 374, 438];might work generically Global $aCS_Pop_General_OKButton[5] = [1541534458, 488, 421, 535, 452] Global $aCS_Pop_Warn_DifferentRatesMayAppy[5] = [1917878847, 333, 355, 690, 456] Global $aCS_Pop_CC_Attach_YN[5] = [2252997265, 350, 361, 676, 451] Global $aCS_Pop_CC_Existing_OC[5] = [1066516122, 238, 303, 936, 350] Global $aCS_Pop_Res_Conf_OK[5] = [3243176568, 485, 415, 541, 449] Global $aCS_Win_OptionsinFocus[5] = [2976217248, 387, 240, 516, 291] Global $aCS_Win_AccompinFocus[5] = [1441538536, 360, 348, 533, 365] #EndRegion PixelChecksum Data #EndRegion Global Variables #EndRegion Declare Descriptors, Tags and Initialise Reservations Array. Declare Global Variables and Constants. #Region Validate Correct PC If Not (@ComputerName = "WS02") Or Not (DriveGetSerial(@HomeDrive & "\") = 3626272696) Then MsgBox(0, "", "Geht aktuell am Rechten PC") Exit EndIf #EndRegion Validate Correct PC #Region CopyAndGet HotKeySet("{ESC}", "_Exit") Global $sSplashTextTitle = StringTrimRight(@ScriptName, 4) & " - " & "Abbrechen jederzeit mit ""Esc"" Taste möglich! - Benutzung mit eigener Verantwortung." SplashTextOn($sSplashTextTitle, "skript wartet bis eine ganze #blablabla# Email, oder ganzer #blablabla# PDF Text, mit Ctrl+C kopiert ist", 512 + 128 + 128, 42, -1, 1, 32 + 16) HotKeySet("^c", "CopyAndGet") While 1 Sleep(64) WEnd Func CopyAndGet() SplashOff() SplashTextOn($sSplashTextTitle, "reservierung wird geladen...", 512 + 128, 42, -1, 1, 32 + 16) HotKeySet("^c") Send("^c") Parseblabla1Email(ClipGet() & @CRLF) Parseblabla2PDF(ClipGet() & @CRLF) ;Parseblabla3(ClipGet(), "username", "password", 0) ;Parseblabla4Email(ClipGet()&@CRLF) ;testreservation() forreservationinreservations() SplashTextOn($sSplashTextTitle, "skript wartet bis eine ganze #blablabla# Email, oder ganzer #blablabla# PDF Text, mit Ctrl+C kopiert ist", 512 + 128 + 128, 42, -1, 1, 32 + 16) HotKeySet("^c", "CopyAndGet") EndFunc ;==>CopyAndGet #EndRegion CopyAndGet There are multiple Parsing functions, maybe not post those due to passwords etc. (that´s the only part I´m not posting, otherwise this is the script, in that order, at the moment, this is one I have as a template: #Region Parsers #Region Template for new reservation functino Func newreservationtemplate($sSource = "") Local $m = UBound($aReservations, 1) ReDim $aReservations[$m + 1][UBound($aReservations, 2)] $aReservations[$m][$ixReservationCode] = $ixINDEX[$ixReservationCode] #Region Profile $aReservations[$m][$ixGuestSurName] = $ixINDEX[$ixGuestSurName] $aReservations[$m][$ixGuestFirstName] = $ixINDEX[$ixGuestFirstName] $aReservations[$m][$ixGuestTitle] = $ixINDEX[$ixGuestTitle] $aReservations[$m][$ixAccompGuestSurName] = $ixINDEX[$ixAccompGuestSurName] $aReservations[$m][$ixAccompGuestFirstName] = $ixINDEX[$ixAccompGuestFirstName] $aReservations[$m][$ixAccompGuestTitle] = $ixINDEX[$ixAccompGuestTitle] $aReservations[$m][$ixGuestAddressStreet] = $ixINDEX[$ixGuestAddressStreet] $aReservations[$m][$ixGuestAddressCity] = $ixINDEX[$ixGuestAddressCity] $aReservations[$m][$ixGuestAddressPostcode] = $ixINDEX[$ixGuestAddressPostcode] $aReservations[$m][$ixGuestAddressCountryCode] = $ixINDEX[$ixGuestAddressCountryCode] $aReservations[$m][$ixGuestEmail] = $ixINDEX[$ixGuestEmail] $aReservations[$m][$ixGuestPhone] = $ixINDEX[$ixGuestPhone] #EndRegion Profile #Region Agent/Company/Group $aReservations[$m][$ixAgent] = $ixINDEX[$ixAgent] $aReservations[$m][$ixCompany] = $ixINDEX[$ixCompany] $aReservations[$m][$ixGroup] = $ixINDEX[$ixGroup] #EndRegion Agent/Company/Group #Region Checkin/Checkout $aReservations[$m][$ixCheckInDay] = $ixINDEX[$ixCheckInDay] $aReservations[$m][$ixCheckInMonth] = $ixINDEX[$ixCheckInMonth] $aReservations[$m][$ixCheckInYear] = $ixINDEX[$ixCheckInYear] $aReservations[$m][$ixCheckoutDay] = $ixINDEX[$ixCheckoutDay] $aReservations[$m][$ixCheckoutMonth] = $ixINDEX[$ixCheckoutMonth] $aReservations[$m][$ixCheckoutYear] = $ixINDEX[$ixCheckoutYear] #EndRegion Checkin/Checkout #Region Reseration major $aReservations[$m][$ixNumPersons] = $ixINDEX[$ixNumPersons] $aReservations[$m][$ixNumChildren] = $ixINDEX[$ixNumChildren] $aReservations[$m][$ixNumRooms] = $ixINDEX[$ixNumRooms] $aReservations[$m][$ixRoomType] = $ixINDEX[$ixRoomType] $aReservations[$m][$ixRateCode] = $ixINDEX[$ixRateCode] $aReservations[$m][$ixAddonPackages] = $ixINDEX[$ixAddonPackages] #EndRegion Reseration major #Region Statistic Fields $aReservations[$m][$ixResType] = $ixINDEX[$ixResType] $aReservations[$m][$ixResMarket] = $ixINDEX[$ixResMarket] $aReservations[$m][$ixResSource] = $ixINDEX[$ixResSource] $aReservations[$m][$ixResOrigin] = $ixINDEX[$ixResOrigin] #EndRegion Statistic Fields #Region Payment $aReservations[$m][$ixPaymentType] = $ixINDEX[$ixPaymentType] $aReservations[$m][$ixCreditCardNumber] = $ixINDEX[$ixCreditCardNumber] $aReservations[$m][$ixCreditCardExpiryMonth] = $ixINDEX[$ixCreditCardExpiryMonth] $aReservations[$m][$ixCreditCardExpiryYear] = $ixINDEX[$ixCreditCardExpiryYear] #EndRegion Payment $aReservations[$m][$ixReservationComment] = $ixINDEX[$ixReservationComment] EndFunc ;==>newreservationtemplate #EndRegion Template for new reservation functino #EndRegion Parsers Here is the most essential and last section/chunk: #Region Summarise and query confirmation Func forreservationinreservations() Local $sSummary For $iReservation = 0 To UBound($aReservations, 1) - 1 $sSummary = "++++Reservation #" & $iReservation + 1 & "/" & UBound($aReservations, 1) & ":++++++++++++++++++++++++++" & @CR For $index = 0 To $ix - 1 $sSummary &= $ixINDEX[$index] & ":" & @TAB & $aReservations[$iReservation][$index] & @CR Next $sSummary &= "++++++++++++++++++++++++++++++++++++++++++" queryentryconfirm($sSummary, $iReservation) Next Global $aReservations[0][$ix] ;Reset the Array If MsgBox(262144 + 32 + 4 + 256, @ScriptName, "Fertig!" & @CRLF & @CRLF & "gleich mit der nächsten Buchung weitermachen?") <> 6 Then _Exit() EndFunc ;==>forreservationinreservations Func queryentryconfirm($sSummary, $iReservation) SplashOff() Local $msg = MsgBox(262144 + 0 + 0 + 1, @ScriptName, $sSummary) If $msg = 2 Then ;Cancel ElseIf $msg = 1 Then ;OK SplashTextOn($sSplashTextTitle, "skript wartet bis ein OPERA geöffnet und leer ist", 512 + 128, 42, -1, 1, 32 + 16) EnterInOpera($iReservation) EndIf EndFunc ;==>queryentryconfirm #EndRegion Summarise and query confirmation #Region EnterInOpera Func EnterInOpera($m) Local $iTimeOut Local $iTempNewProfile Global $wHandleOpera Global $cHandleOpera #Region Opera Start While 1 Local $hTempWinList = WinList() For $i = 1 To $hTempWinList[0][0] If StringInStr(WinGetTitle($hTempWinList[$i][1]), $sOperaWinTitle) Then WinActivate($hTempWinList[$i][1]) $wHandleOpera = $hTempWinList[$i][1] WinMove($wHandleOpera, "", Default, Default, 1024, 768, 20) Sleep(128) If CSTestInOpera($aCS_Misc_AllBlue) Then ExitLoop EndIf Next While Not WinActive($sOperaWinTitle) Or Not CSTestInOpera($aCS_Misc_AllBlue) For $i = 1 To $hTempWinList[0][0] If StringInStr(WinGetTitle($hTempWinList[$i][1]), $sOperaWinTitle) And Not WinActive($hTempWinList[$i][1]) Then WinFlash($hTempWinList[$i][1], "", 2, 128) Next If WinActive($sOperaWinTitle) Then $wHandleOpera = WinActivate($sOperaWinTitle) WinMove($wHandleOpera, "", Default, Default, 1024, 768, 20) EndIf WEnd $wHandleOpera = WinActivate($sOperaWinTitle) $cHandleOpera = ControlGetHandle($wHandleOpera, "", "") #Region Blocking OnAutoItExitRegister("UnDoBlockInactiveWindowsAndMouse") BlockInactiveWindowsAndMouse() AdlibRegister("AdlibCheckWinStillActive", 128) #EndRegion Blocking SplashOff() If MsgBox(262144 + 32 + 1, @ScriptName, "mit diesem Fenster weitermachen?") = 1 Then ExitLoop Else _Exit() EndIf WEnd BlockInactiveWindowsAndMouse(1);re-_MouseTrap because the MsgBox releases it. #EndRegion Opera Start #Region New Reservation Start ProgressOn($sSplashTextTitle, "skript gibt die Reservierung ein", "New Reservation", Default, 0) WinActivate($wHandleOpera) OperaSend("{F7}") WaitWhileCs("NOT", $aCS_Window_NewReservation, 64, 5, $aCS_Misc_InFocusReservation, "AND") OperaSend("!.") ProgressSet(5, "Guest Profile") WaitWhileCs("NOT", $aCS_Misc_ProfileSearchNoResultSelected, 64, 5) OperaSendClipTab($aReservations[$m][$ixGuestSurName]) OperaSendClipTab($aReservations[$m][$ixGuestFirstName]) IndividualProfileSearch() #EndRegion New Reservation Start #Region Profile Select/New $iTempNewProfile = 0 If CSTestInOpera($aCS_Misc_ProfileSearchWithFirstResultSelected) = 1 Then Local $iProfileMsgBoxAnswer = MsgBox(262144 + 32 + 4, @ScriptName, "Selektiertes Profil verwenden?" & @CRLF & "(automatisch Ja in 7 sekunden)", 7) BlockInactiveWindowsAndMouse(1);re-_MouseTrap because the MsgBox releases it. If $iProfileMsgBoxAnswer <= 6 Then;Yes or Timeout OperaSend("!o") WaitWhileCs("NOT", $aCS_Misc_InFocusReservation, 64, 10) OperaTab(-4) ElseIf $iProfileMsgBoxAnswer = 7 Then;No $iTempNewProfile = 1 EndIf ElseIf CSTestInOpera($aCS_Misc_ProfileSearchNoResultSelected) = 1 Then $iTempNewProfile = 1 Else MsgBox(0, @ScriptName, "Error2. Will abort.", 2) Exit;#########improve error handling############## EndIf #Region Enter New Profile Details If $iTempNewProfile = 1 Then OperaSend("!n") WaitWhileCs("NOT", $aCS_Win_IndividualProfilInFocus, 16, 10) OperaTab(4) OperaSendClipTab($aReservations[$m][$ixGuestTitle]) OperaSendClipTab($aReservations[$m][$ixGuestAddressStreet], 3) OperaSendClipTab($aReservations[$m][$ixGuestAddressCity]) OperaSendClipTab($aReservations[$m][$ixGuestAddressPostcode], 2) OperaSendClip($aReservations[$m][$ixGuestAddressCountryCode]) If StringInStr($aReservations[$m][$ixGuestEmail], "@") > 0 Or StringLen($aReservations[$m][$ixGuestPhone]) > 4 Then OperaTab(13) If StringInStr($aReservations[$m][$ixGuestEmail], "@") > 0 Then OperaSendClipTab("EMAIL") OperaSendClipTab($aReservations[$m][$ixGuestEmail]) EndIf If StringLen($aReservations[$m][$ixGuestPhone]) > 4 Then OperaSendClipTab("HOME") OperaSendClipTab($aReservations[$m][$ixGuestPhone]) EndIf EndIf OperaSend("!o") WaitWhileCs("NOT", $aCS_Misc_InFocusReservation, 64, 10) OperaTab(-4) EndIf #EndRegion Enter New Profile Details #EndRegion Profile Select/New ProgressSet(30, "Agent/Company/Group") #Region Agent Company Group If $aReservations[$m][$ixAgent] <> "" Then;#######Watch out for negotiated Rate Window! TakeFirstResult($aReservations[$m][$ixAgent]) Else OperaTab() EndIf If $aReservations[$m][$ixCompany] <> "" Then;#######Watch out for negotiated Rate Window! TakeFirstResult($aReservations[$m][$ixCompany]) Else OperaTab() EndIf If $aReservations[$m][$ixGroup] <> "" Then TakeFirstResult($aReservations[$m][$ixGroup]) Else OperaTab() EndIf #EndRegion Agent Company Group ProgressSet(40, "TA Rec Loc, Checkin/Checkout, Persons, Children, Rooms") #Region Basic Reservation Data OperaSendClipTab($aReservations[$m][$ixReservationCode]) OperaSendClipTab($aReservations[$m][$ixCheckInDay] & $aReservations[$m][$ixCheckInMonth] & $aReservations[$m][$ixCheckInYear], 2) OperaSendClipTab($aReservations[$m][$ixCheckoutDay] & $aReservations[$m][$ixCheckoutMonth] & $aReservations[$m][$ixCheckoutYear]) OperaSendTab($aReservations[$m][$ixNumPersons]) OperaSendTab($aReservations[$m][$ixNumChildren]) OperaSendTab($aReservations[$m][$ixNumRooms]) #EndRegion Basic Reservation Data ProgressSet(55, "Roomtype, Rate Code") #Region Room Rate and Packages OperaSendClipTab($aReservations[$m][$ixRoomType], 3) OperaSendRawTab($aReservations[$m][$ixRateCode]) Sleep(350);300.06 accoring to test was minimum#################### If CSTestInOpera($aCS_Pop_Warn_DifferentRatesMayAppy) = 1 Then OperaSend("{ENTER}") WaitWhileCs("NOT", $aCS_Misc_InFocusReservation, 64, 10) EndIf #EndRegion Room Rate and Packages ProgressSet(70, "Reservation Type, Market, Source, Origin") #Region Statistics and Categories OperaTab(5) OperaSendRawTab($aReservations[$m][$ixResType]) OperaSendRawTab($aReservations[$m][$ixResMarket]) OperaSendRawTab($aReservations[$m][$ixResSource]) OperaSendRawTab($aReservations[$m][$ixResOrigin]) #EndRegion Statistics and Categories ProgressSet(80, "Payment") #Region Payment If $aReservations[$m][$ixPaymentType] = "" Or $aReservations[$m][$ixPaymentType] = "CA" Then OperaSendRaw("CA") ElseIf $aReservations[$m][$ixPaymentType] = "CL" Then OperaSendRaw("CL") Else OperaSendRawTab($aReservations[$m][$ixPaymentType]) WaitWhileCs("NOT", $aCS_Pop_CC_Attach_YN, 64, 10, $aCS_Pop_CC_Existing_OC, "AND") If CSTestInOpera($aCS_Pop_CC_Attach_YN) Then OperaSend("!y") If CSTestInOpera($aCS_Pop_CC_Existing_OC) Then OperaSend("!c") WaitWhileCs("NOT", $aCS_Pop_CC_Attach_YN, 64, 10) OperaSend("!y") EndIf WaitWhileCs("NOT", $aCS_Misc_InFocusReservation, 64, 10) OperaSendClipTab($aReservations[$m][$ixCreditCardNumber], 1) OperaSendClipTab($aReservations[$m][$ixCreditCardExpiryMonth] & $aReservations[$m][$ixCreditCardExpiryYear], 1) EndIf #EndRegion Payment ProgressSet(85, "Comment") #Region Comment OperaSendClip($aReservations[$m][$ixReservationComment]) #EndRegion Comment ProgressSet(90, "Saving") #Region Confirmation OperaSend("!s") ;Can happen "Existing Reservation for same name for same dates Popup WaitWhileCs("NOT", $aCS_Pop_Res_Conf_OK, 16, 10) If CSTestInOpera($aCS_Pop_Res_Conf_OK) Then OperaSend("!o") EndIf #EndRegion Confirmation #Region Accompanying If $aReservations[$m][$ixAccompGuestSurName] <> "" Then ProgressSet(95, "Accompanying") WaitWhileCs("NOT", $aCS_Misc_InFocusReservation, 64, 10) #Region Open Accompanying Profile Search OperaSend("!t");Open Options WaitWhileCs("NOT", $aCS_Win_OptionsinFocus, 64, 5) OperaSend("!y");Select "accompanYing" WaitWhileCs("NOT", $aCS_Misc_ProfileSearchNoResultSelected, 64, 5) OperaSendClipTab($aReservations[$m][$ixAccompGuestSurName]) OperaSendClipTab($aReservations[$m][$ixAccompGuestFirstName]) IndividualProfileSearch() #EndRegion Open Accompanying Profile Search $iTempNewProfile = 0 If CSTestInOpera($aCS_Misc_ProfileSearchWithFirstResultSelected) = 1 Then $iProfileMsgBoxAnswer = MsgBox(262144 + 32 + 4, @ScriptName, "Selektiertes Profil verwenden?" & @CRLF & "(automatisch Ja in 7 sekunden)", 7) BlockInactiveWindowsAndMouse(1);re-_MouseTrap because the MsgBox releases it. If $iProfileMsgBoxAnswer <= 6 Then;Yes or Timeout OperaSend("!o") ElseIf $iProfileMsgBoxAnswer = 7 Then;No $iTempNewProfile = 1 EndIf ElseIf CSTestInOpera($aCS_Misc_ProfileSearchNoResultSelected) = 1 Then $iTempNewProfile = 1 Else MsgBox(0, @ScriptName, "Error2. Will abort.", 2) Exit;#########todo: improve error handling############## EndIf If $iTempNewProfile = 1 Then OperaSend("!n") WaitWhileCs("", $aCS_Win_IndividualProfilInFocus, 16, 10) OperaTab(4) OperaSendClipTab($aReservations[$m][$ixAccompGuestTitle]) EndIf OperaSend("!o") WaitWhileCs("NOT", $aCS_Win_AccompinFocus, 64, 7) OperaSend("!c") WaitWhileCs("NOT", $aCS_Win_OptionsinFocus, 64, 7) OperaSend("!c") EndIf #EndRegion Accompanying ProgressSet(100, "Finished!") #Region UnBlocking AdlibUnRegister("AdlibCheckWinStillActive") UnDoBlockInactiveWindowsAndMouse() OnAutoItExitUnRegister("UnDoBlockInactiveWindowsAndMouse") #EndRegion UnBlocking ProgressOff() EndFunc ;==>EnterInOpera Func IndividualProfileSearch() OperaSendRaw("i");Individual OperaSend("{ENTER}") WaitWhileCs("", $aCS_Misc_ProfileSearchInProgress, 64, 3) Sleep(256) WaitForTheMouse() EndFunc ;==>IndividualProfileSearch #Region WaitForCS Function Func WaitWhileCs($not, $aCS, $checkeveryms = 16, $timeoutseconds = 10, $aCS2 = False, $AndOr = "OR") Local $iTimeOut = 0 If $aCS2 = False Then If $not = "NOT" Then cr("NOT") While Not CSTestInOpera($aCS) Sleep($checkeveryms) $iTimeOut += $checkeveryms If $iTimeOut > (1000 * $timeoutseconds) Then TimedOut() WEnd Else cr("=") While CSTestInOpera($aCS) Sleep($checkeveryms) $iTimeOut += $checkeveryms If $iTimeOut > (1000 * $timeoutseconds) Then TimedOut() WEnd EndIf ElseIf $AndOr = "OR" Then If $not = "NOT" Then cr("OR NOT") While Not CSTestInOpera($aCS) Or CSTestInOpera($aCS2) Sleep($checkeveryms) $iTimeOut += $checkeveryms If $iTimeOut > (1000 * $timeoutseconds) Then TimedOut() WEnd Else cr("OR") While CSTestInOpera($aCS) Or CSTestInOpera($aCS2) Sleep($checkeveryms) $iTimeOut += $checkeveryms If $iTimeOut > (1000 * $timeoutseconds) Then TimedOut() WEnd EndIf ElseIf $AndOr = "AND" Then If $not = "NOT" Then cr("AND NOT") While Not CSTestInOpera($aCS) And Not CSTestInOpera($aCS2) Sleep($checkeveryms) $iTimeOut += $checkeveryms If $iTimeOut > (1000 * $timeoutseconds) Then TimedOut() WEnd Else cr("AND") While CSTestInOpera($aCS) And CSTestInOpera($aCS2) Sleep($checkeveryms) $iTimeOut += $checkeveryms If $iTimeOut > (1000 * $timeoutseconds) Then TimedOut() WEnd EndIf EndIf EndFunc ;==>WaitWhileCs #EndRegion WaitForCS Function Func TimedOut() _Exit() EndFunc ;==>TimedOut #Region OperaSend Func TakeFirstResult($sString) OperaSendClipTab($sString) WaitWhileCs("NOT", $aCS_Misc_ProfileSearchNoResultSelected, 64, 10) OperaSend("!o") Sleep(256) WaitWhileCs("NOT", $aCS_Misc_InFocusReservation, 64, 10, $aCS_Pop_General_OKButton, "AND") If CSTestInOpera($aCS_Pop_General_OKButton) = 1 Then OperaSend("!o") WaitWhileCs("NOT", $aCS_Misc_InFocusReservation, 64, 10) EndIf EndFunc ;==>TakeFirstResult Func OperaSendRaw($sSend) OperaSend($sSend, 1) EndFunc ;==>OperaSendRaw Func OperaSendRawTab($sSend, $i = 1) OperaSend($sSend, 1) OperaTab($i) EndFunc ;==>OperaSendRawTab Func OperaSendClip($sSend) OperaSend($sSend, 2) EndFunc ;==>OperaSendClip Func OperaSendClipTab($sSend, $i = 1) OperaSend($sSend, 2) OperaTab($i) EndFunc ;==>OperaSendClipTab Func OperaSendTab($sSend, $i = 1) OperaSend($sSend) OperaTab($i) EndFunc ;==>OperaSendTab Func OperaTab($n = 1) If $n = 1 Then OperaSend("{TAB}") ElseIf $n > 1 Then OperaSend("{TAB " & $n & "}") ElseIf $n < 1 Then OperaSend("+{TAB " & Abs($n) & "}") EndIf EndFunc ;==>OperaTab Func OperaSend($sSend, $flag = 0) WaitForTheMouse() If $flag = 2 Then ClipPut("") ClipPut($sSend) Sleep(128);Must not be removed Do Local $x = ControlSend($wHandleOpera, "", $cHandleOpera, "^v") Until $x = 1 ;Sleep(128) Else Sleep(64) Do $x = ControlSend($wHandleOpera, "", $cHandleOpera, $sSend, $flag) Until $x = 1 EndIf EndFunc ;==>OperaSend Func WaitForTheMouse() While MouseGetCursor() <> 2 ;cr("WaitForTheMouse") Sleep(100) WEnd EndFunc ;==>WaitForTheMouse #EndRegion OperaSend #Region PixelChecksum Func CSTestInOpera($aCheckSumTest, $iCheckSumStep = 1, $bCheckSumMode = 1) If WinExists($wHandleOpera) And UBound($aCheckSumTest) = 5 Then Local $aCheckSum = PixelChecksum($aCheckSumTest[1], $aCheckSumTest[2], $aCheckSumTest[3], $aCheckSumTest[4], $iCheckSumStep, $wHandleOpera, $bCheckSumMode) If $aCheckSum = $aCheckSumTest[0] Then Return True Else Return False EndIf Else SetError(1) Return False EndIf EndFunc ;==>CSTestInOpera #EndRegion PixelChecksum #Region Blocking Func AdlibCheckWinStillActive() If Not WinActive($wHandleOpera) Then WinActivate($wHandleOpera) If @error Then _Exit() EndIf EndIf EndFunc ;==>AdlibCheckWinStillActive Func BlockInactiveWindowsAndMouse($flag = 0);if Flag = 1 then just reblock mouse ;Note: Check out http://www.autoitscript.com/forum/topic/87735-blockinputex-udf/ If $flag = 0 Then WinSetOnTop($wHandleOpera, "", 1) WinSetState($wHandleOpera, "", @SW_DISABLE) Global $aBlockerWinList = WinList() For $i = 1 To $aBlockerWinList[0][0] If BitAND(WinGetState($aBlockerWinList[$i][1]), 2) And BitAND(WinGetState($aBlockerWinList[$i][1]), 4) And $aBlockerWinList[$i][1] <> $wHandleOpera Then;Visible+Enabled+NotActive WinSetState($aBlockerWinList[$i][1], "", @SW_DISABLE) $aBlockerWinList[$i][0] = 1 Else $aBlockerWinList[$i][0] = 0 EndIf Next WinMove($wHandleOpera, "", Default, Default, 1024, 768) EndIf Local $aTempWinGetPos = WinGetPos($wHandleOpera) _MouseTrap($aTempWinGetPos[0] + Int($aTempWinGetPos[2] / 2), $aTempWinGetPos[1] + Int($aTempWinGetPos[3] / 2), $aTempWinGetPos[0] + Int($aTempWinGetPos[2] / 2), $aTempWinGetPos[1] + Int($aTempWinGetPos[3] / 2)) If Not WinActive($wHandleOpera) Then WinActivate($wHandleOpera) EndFunc ;==>BlockInactiveWindowsAndMouse Func UnDoBlockInactiveWindowsAndMouse() _MouseTrap() WinSetOnTop($wHandleOpera, "", 0) For $i = 1 To $aBlockerWinList[0][0] If $aBlockerWinList[$i][0] = 1 Then WinSetState($aBlockerWinList[$i][1], "", @SW_ENABLE) EndIf Next If Not WinActive($wHandleOpera) Then WinActivate($wHandleOpera) WinSetState($wHandleOpera, "", @SW_ENABLE) EndFunc ;==>UnDoBlockInactiveWindowsAndMouse #EndRegion Blocking #EndRegion EnterInOpera #Region Basic Script Functions (Exit, CR, NA) Func _Exit() Exit EndFunc ;==>_Exit Func cr($text = "") ;Print to console ConsoleWrite($text & @CR) Return $text EndFunc ;==>cr Func na($aArray) If IsArray($aArray) Then Return $aArray[0] ElseIf IsString($aArray) Then Return $aArray Else SetError(1) Return "" EndIf EndFunc ;==>na #EndRegion Basic Script Functions (Exit, CR, NA) This is my biggest scripting project so far. In it´s current state the script already works and is useful. Next step, after fixing the issue that I can´t really read it anymore, is to improve and expand it. As you can see I´m automating the input of reservations into some software. See an older post '?do=embed' frameborder='0' data-embedContent>> to find out what the trouble with the indirect ControlSend is about. I had an older version that I rewrote to this, after I understood how to deal with multi-dimensional arrays and Enumeration, which I´m using heavily.
  17. As the title says. Not talking about the formatting and tabs (bless the Tidy function in Scite4AutoIt that takes care of that). I have written a script that has gotten quite large, and I want to make/keep it tidier than it is at the moment. I´ve more-or-less used the variable prefixes descibed in the Wiki under Best_coding_practices, used correctish scopes... Anybody have system for going through a script and improving this, without breaking it? For example, I have thought of using Search+Replace to rename variables... ...I´m getting lost in my script! please, if you have "method" of cleaning up a script that has become less readable, let me know!
  18. Please let me understand how to do this be able to use formatted text from the clipboard as source material for parsing and interpreting later... ClipGet() get me the text of course, and that has brought me lots of fine results already, however now I will try to work with data that isn´t purely text, but from an e-mail and/or a webpage with the text in different table with different formatting. So I would like to fetch data from the clipboard with the formatting (tables, bold, etc.), just like if I would copy something from a page or an e-mail and paste it into MS Word.. If I use ClipGet, the table structures and formatting etc. (that would be usefull for parsing) seem to be ignored... ...so I suppose _ClipBoard_GetData or _ClipBoard_GetDataEx are for this? I believe the data format I want/need is $CF_LOCALE, and I have achieved, as a test, successfully getting the data with _ClipBoard_GetDataEx, and then setting it with _ClipBoard_SetDataEx and checking if it is in the right format when pasting in to MS Word. Now the challenge: How to I work with this data handle, i.e. this binary data, in a way where I can basically do things like parse it with StringRegExp etc.? Can the binary data somehow be converted into a sort of html code or so? Example1: If I have copied a line of text onto the clipboard, with one word in bold, how do I put that word in a variable in AutoIt? Example2: If I have copied a simple 2x2 Table from an e-mail or webpage, how do I put that into an Array?
  19. Anybody have experience/ideas about doing this?
  20. P.S. If anyone has interest (or can improve the direction I´m taking) here are snippets of how the "dirty" method is working. (any pointers in regards to best coding practice would be great) Global $wHandleOpera Global $cHandleOpera $wHandleOpera = WinActivate($sOperaWinTitle) $cHandleOpera = ControlGetHandle($wHandleOpera, "", "") Func OperaSend($sSend, $flag = 0) WaitForTheMouse() If $flag = 2 Then ClipPut("") ClipPut($sSend) Sleep(128);Must not be removed Do Local $x = ControlSend($wHandleOpera, "", $cHandleOpera, "^v") Until $x = 1 ;Sleep(128) Else Sleep(64) Do $x = ControlSend($wHandleOpera, "", $cHandleOpera, $sSend, $flag) Until $x = 1 EndIf EndFunc ;==>OperaSend Func WaitForTheMouse() While MouseGetCursor() <> 2 ;cr("WaitForTheMouse") Sleep(100) WEnd EndFunc ;==>WaitForTheMouse Func CSTestInOpera($aCheckSumTest, $iCheckSumStep = 1, $bCheckSumMode = 1) ;$aCheckSumTest is Array where [0] is a checksum and [1]-[4] are left, top, right and bottom coordinates respectively. ;Window Handle from Global Scope. Option "PixelCoordMode" needs to be set to 0=relative. If WinExists($wHandleOpera) And UBound($aCheckSumTest) = 5 Then Local $aCheckSum = PixelChecksum($aCheckSumTest[1], $aCheckSumTest[2], $aCheckSumTest[3], $aCheckSumTest[4], $iCheckSumStep, $wHandleOpera, $bCheckSumMode) If $aCheckSum = $aCheckSumTest[0] Then Return True Else Return False EndIf Else SetError(1) Return False EndIf EndFunc ;==>CSTestInOpera Func AdlibCheckWinStillActive() If Not WinActive($wHandleOpera) Then WinActivate($wHandleOpera) If @error Then _Exit() EndIf EndIf EndFunc ;==>AdlibCheckWinStillActive Func BlockInactiveWindowsAndMouse($flag = 0);if Flag = 1 then just reblock mouse ;Note: Check out http://www.autoitscript.com/forum/topic/87735-blockinputex-udf/ If $flag = 0 Then WinSetOnTop($wHandleOpera, "", 1) WinSetState($wHandleOpera, "", @SW_DISABLE) Global $aBlockerWinList = WinList() For $i = 1 To $aBlockerWinList[0][0] If BitAND(WinGetState($aBlockerWinList[$i][1]), 2) And BitAND(WinGetState($aBlockerWinList[$i][1]), 4) And $aBlockerWinList[$i][1] <> $wHandleOpera Then;Visible+Enabled+NotActive WinSetState($aBlockerWinList[$i][1], "", @SW_DISABLE) $aBlockerWinList[$i][0] = 1 Else $aBlockerWinList[$i][0] = 0 EndIf Next WinMove($wHandleOpera, "", Default, Default, 1024, 768) EndIf Local $aTempWinGetPos = WinGetPos($wHandleOpera) _MouseTrap($aTempWinGetPos[0] + Int($aTempWinGetPos[2] / 2), $aTempWinGetPos[1] + Int($aTempWinGetPos[3] / 2), $aTempWinGetPos[0] + Int($aTempWinGetPos[2] / 2), $aTempWinGetPos[1] + Int($aTempWinGetPos[3] / 2)) If Not WinActive($wHandleOpera) Then WinActivate($wHandleOpera) EndFunc ;==>BlockInactiveWindowsAndMouse Func UnDoBlockInactiveWindowsAndMouse() _MouseTrap() WinSetOnTop($wHandleOpera, "", 0) For $i = 1 To $aBlockerWinList[0][0] If $aBlockerWinList[$i][0] = 1 Then WinSetState($aBlockerWinList[$i][1], "", @SW_ENABLE) EndIf Next If Not WinActive($wHandleOpera) Then WinActivate($wHandleOpera) WinSetState($wHandleOpera, "", @SW_ENABLE) EndFunc ;==>UnDoBlockInactiveWindowsAndMouse
  21. Thanks junkew. For my current skill level the code looks heavy, and besides I highly doubt that the App I want to automate supports accessibility... (I´ve done some research on JAB before when trying to use the Java UDF ('?do=embed' frameborder='0' data-embedContent>>) by seangriffin). Thanks a lot anyway! I´m marking the thread as "solved", as the question, thanks to you, has been answered as well as possible for now I reckon. Planning to instead continue cleaning up my "dirty" method with PixelChecksums and ControlSend (to the overall window) as much as possible... (I´ve made progress with that to a point that actually looks quite satisfying)
  22. Cheers for the quick and simple response! Although even better for the future would be to have a grip on why. It says in the helpfile: When more than one operator is used in an expression the order in which things happen is controlled by operator precedence. The precedence used in AutoIt is given below. Where two operators have the same precedence the expression is evaluated left to right. From highest precedence to lowest: Not ^ * / + - & < > <= >= = <> == And Or So since "Not" has the highest precedence, including over "And", wouldn´t it apply to the remaining statements in a line like: ? While NOT Func1() AND Func2() ...So I guess the answer is it wouldn´t. P.S. I mean in terms of understanding the precedences, While NOT (Func1() AND Func2()) would I guess apply to both functions, but that would have more to do with the brackets than the precendence between And and Not... P.P.S. ;so While NOT Func1() AND Func2() ;is the same as While (NOT Func1()) AND Func2() ;and While NOT Func1() AND NOT Func2() ;is the same as While NOT (Func1() AND Func2()) yes? :-)
  23. I´m getting mixed up! What´s the difference between: While NOT Func1() AND Func2() and While NOT Func1() AND NOT Func2() ?? I´m using lots of these and it works find, but now that I´m rewriting my script I´m mixing things up and getting unsure.
  24. #include <IE.au3> $oIE = _IECreate(....) ; put the url inside $sTxt = $oIE.Document.GetElementsByClassName("the meltmail").item(0).innertext MsgBox(0, "", $sTxt)
  25. First of all thank you very much for the recommendation. I downloaded the include files and ran the "simple spy demo" from the first post in that thread. With my java interface window in focus, and the caret in an edit box selecting the text "asdasdasdasd" as a test, I got what I have pasted below. Maybe this can help you help me help myself? Mouse position is retrieved 649-314 At least we have an element [MYWINDOWTITLEWASHERE ][SunAwtFrame] Having the following values for all properties: Title is: <MYWINDOWTITLEWASHERE > Class := <SunAwtFrame> controltype:= <UIA_WindowControlTypeId> ,<50032> , (0000C370) *** Parent Information *** Title is: <Desktop> Class := <#32769> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) *** Detailed properties of the highlighted element *** UIA_AcceleratorKeyPropertyId := UIA_AccessKeyPropertyId :=Alt+ UIA_AriaPropertiesPropertyId := UIA_AriaRolePropertyId := UIA_AutomationIdPropertyId := UIA_BoundingRectanglePropertyId :=448;156;1007;694 UIA_ClassNamePropertyId :=SunAwtFrame UIA_ClickablePointPropertyId := UIA_ControllerForPropertyId := UIA_ControlTypePropertyId :=50032 UIA_CulturePropertyId :=0 UIA_DescribedByPropertyId := UIA_DockDockPositionPropertyId :=5 UIA_ExpandCollapseExpandCollapseStatePropertyId :=3 UIA_FlowsToPropertyId := UIA_FrameworkIdPropertyId :=Win32 UIA_GridColumnCountPropertyId :=0 UIA_GridItemColumnPropertyId :=0 UIA_GridItemColumnSpanPropertyId :=1 UIA_GridItemContainingGridPropertyId := UIA_GridItemRowPropertyId :=0 UIA_GridItemRowSpanPropertyId :=1 UIA_GridRowCountPropertyId :=0 UIA_HasKeyboardFocusPropertyId :=True UIA_HelpTextPropertyId := UIA_IsContentElementPropertyId :=True UIA_IsControlElementPropertyId :=True UIA_IsDataValidForFormPropertyId :=False UIA_IsDockPatternAvailablePropertyId :=False UIA_IsEnabledPropertyId :=True UIA_IsExpandCollapsePatternAvailablePropertyId :=False UIA_IsGridItemPatternAvailablePropertyId :=False UIA_IsGridPatternAvailablePropertyId :=False UIA_IsInvokePatternAvailablePropertyId :=False UIA_IsItemContainerPatternAvailablePropertyId :=False UIA_IsKeyboardFocusablePropertyId :=True UIA_IsLegacyIAccessiblePatternAvailablePropertyId :=True UIA_IsMultipleViewPatternAvailablePropertyId :=False UIA_IsOffscreenPropertyId :=False UIA_IsPasswordPropertyId :=False UIA_IsRangeValuePatternAvailablePropertyId :=False UIA_IsRequiredForFormPropertyId :=False UIA_IsScrollItemPatternAvailablePropertyId :=False UIA_IsScrollPatternAvailablePropertyId :=False UIA_IsSelectionItemPatternAvailablePropertyId :=False UIA_IsSelectionPatternAvailablePropertyId :=False UIA_IsSynchronizedInputPatternAvailablePropertyId :=False UIA_IsTableItemPatternAvailablePropertyId :=False UIA_IsTablePatternAvailablePropertyId :=False UIA_IsTextPatternAvailablePropertyId :=False UIA_IsTogglePatternAvailablePropertyId :=False UIA_IsTransformPatternAvailablePropertyId :=True UIA_IsValuePatternAvailablePropertyId :=False UIA_IsVirtualizedItemPatternAvailablePropertyId :=False UIA_IsWindowPatternAvailablePropertyId :=True UIA_ItemStatusPropertyId := UIA_ItemTypePropertyId := UIA_LabeledByPropertyId := UIA_LegacyIAccessibleChildIdPropertyId :=0 UIA_LegacyIAccessibleDefaultActionPropertyId := UIA_LegacyIAccessibleDescriptionPropertyId := UIA_LegacyIAccessibleHelpPropertyId := UIA_LegacyIAccessibleKeyboardShortcutPropertyId :=Alt+ UIA_LegacyIAccessibleNamePropertyId :=MYWINDOWTITLEWASHERE UIA_LegacyIAccessibleRolePropertyId :=10 UIA_LegacyIAccessibleSelectionPropertyId := UIA_LegacyIAccessibleStatePropertyId :=1048580 UIA_LegacyIAccessibleValuePropertyId := UIA_LocalizedControlTypePropertyId :=Fenster UIA_MultipleViewCurrentViewPropertyId :=0 UIA_MultipleViewSupportedViewsPropertyId := UIA_NamePropertyId :=MYWINDOWTITLEWASHERE UIA_NativeWindowHandlePropertyId :=1836932 UIA_OrientationPropertyId :=0 UIA_ProcessIdPropertyId :=2696 UIA_ProviderDescriptionPropertyId :=[pid:5780,hwnd:0x1C0784 Main:Nested [pid:2696,hwnd:0x1C0784 Annotation(parent link):Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main:Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]; Nonclient:Microsoft: Non-Client Proxy (unmanaged:uiautomationcore.dll); Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)] UIA_RangeValueIsReadOnlyPropertyId :=True UIA_RangeValueLargeChangePropertyId :=0 UIA_RangeValueMaximumPropertyId :=0 UIA_RangeValueMinimumPropertyId :=0 UIA_RangeValueSmallChangePropertyId :=0 UIA_RangeValueValuePropertyId :=0 UIA_RuntimeIdPropertyId :=42;1836932 UIA_ScrollHorizontallyScrollablePropertyId :=False UIA_ScrollHorizontalScrollPercentPropertyId :=0 UIA_ScrollHorizontalViewSizePropertyId :=100 UIA_ScrollVerticallyScrollablePropertyId :=False UIA_ScrollVerticalScrollPercentPropertyId :=0 UIA_ScrollVerticalViewSizePropertyId :=100 UIA_SelectionCanSelectMultiplePropertyId :=False UIA_SelectionIsSelectionRequiredPropertyId :=False UIA_SelectionselectionPropertyId := UIA_SelectionItemIsSelectedPropertyId :=False UIA_SelectionItemSelectionContainerPropertyId := UIA_TableColumnHeadersPropertyId := UIA_TableItemColumnHeaderItemsPropertyId := UIA_TableRowHeadersPropertyId := UIA_TableRowOrColumnMajorPropertyId :=2 UIA_TableItemRowHeaderItemsPropertyId := UIA_ToggleToggleStatePropertyId :=2 UIA_TransformCanMovePropertyId :=True UIA_TransformCanResizePropertyId :=True UIA_TransformCanRotatePropertyId :=False UIA_ValueIsReadOnlyPropertyId :=True UIA_ValueValuePropertyId := UIA_WindowCanMaximizePropertyId :=True UIA_WindowCanMinimizePropertyId :=True UIA_WindowIsModalPropertyId :=False UIA_WindowIsTopmostPropertyId :=False UIA_WindowWindowInteractionStatePropertyId :=2 UIA_WindowWindowVisualStatePropertyId :=0 I can see that it found a Window Handle and a Control Handle of some sort... ...just I suspect this control handle is the "one size fits all" that I have resorted to using so far like $wHandleOpera = WinWaitActive($sOperaWinTitle) Global $cHandleOpera = ControlGetHandle($wHandleOpera, "", "") ;..stuff here... ControlSend($wHandleOpera, "", $cHandleOpera, "{TAB}") ClipPut("asfljalsfjlasjflkasj") ControlSend($wHandleOpera, "", $cHandleOpera, "^v") which, in a shaky (script trips when user presses a key or window loses focus, so lots of mouse/key/etc. blocking) and limited (needing pixelchecksums to give the script any kind of "eyes") way, kind of works.... Or can you see something more usable in the results? Can these results indicated yes/no if this software is potentially automatable with the IUIAutomation Functions?
×
×
  • Create New...