
kalel69
Active Members-
Posts
20 -
Joined
-
Last visited
Everything posted by kalel69
-
First, I want to thank both authors of these great UDF's. I just can't seem to get them to work nice together. Any and all help would be appreciated, as I've tried for the past 3 days to get a row to highlight in the table while mousing over it. #include <Table.au3> #include <GUICtrlOnHover.au3> Global $NewCode = "Create New Code" Global $TestHL = "Test Highlight a row in Table" $GUI = GUICreate ("", 450, 450, -1, -1, -1, 0x2000000);----- GUI (Double Buffered) ----- GUICtrlCreateLabel ($TestHL, 40, 10, 400, 40) GUICtrlSetFont (-1, 18,600) $LbCreateCode = GUICtrlCreateLabel ($NewCode, 22, 60, 110, 20) GUICtrlSetColor (-1, 0x0000ff);blue GUICtrlSetFont (-1, 10,400) $Button = GUICtrlCreateButton ("Test Highlight", 22, 90, 100, 20) _GUICtrl_OnHoverRegister($LbCreateCode, "_Hover_Func", "_Hover_Func") _GUICtrl_OnHoverRegister($Button, "_Hover_Func", "_Hover_Func") GUISetState();----- Make sure GUI exists BEFORE creating Tables ----- GUISetState(@SW_LOCK);----- Lock GUI until tables drawn ----- GUICtrlCreateLabel(" Example 1 ", 25, 250, 100, 13);----- Table Example 4 ----- $Table4 = _GUICtrlTable_Create (35, 268, 62, 18, 8, 6, 0) _GUICtrlTable_Set_RowHeight ($Table4, 1, 35) _GUICtrlTable_Set_Justify_All ($Table4, 1, 1) _GUICtrlTable_Set_TextFont_All ($Table4, 8.5, 800, 0, "Tahoma") _GUICtrlTable_Set_CellColor_Row ($Table4, 1, 0x555555) _GUICtrlTable_Set_TextColor_All ($Table4, 0x555555) _GUICtrlTable_Set_TextColor_Row ($Table4, 1, 0xFFFFFF) For $row = 3 To 10 Step 2 _GUICtrlTable_Set_CellColor_Row($Table4, $row, 0xDDDDDD) Next _GUICtrlTable_Set_Text_Row ($Table4, 1, "Fixing|Size|Weight|Net|Gross|Order") _GUICtrlTable_Set_Text_Row ($Table4, 2, "Block|20.0|0.01|300|340|No") _GUICtrlTable_Set_Text_Row ($Table4, 3, "Screw|8.5|0.3|50|100|No") _GUICtrlTable_Set_Text_Row ($Table4, 4, "Rivet|0.1|0.4|10|11|Yes") _GUICtrlTable_Set_Text_Row ($Table4, 5, "Rope|300.0|100.0|2|10|No") _GUICtrlTable_Set_Text_Row ($Table4, 6, "Tack|10.6|0.3|1000|1011|Yes") _GUICtrlTable_Set_Text_Row ($Table4, 7, "Nail|30.3|0.4|400|600|No") _GUICtrlTable_Set_Text_Row ($Table4, 8, "Staple|0.3|0.05|10000|12000|No") _GUICtrlTable_Set_Border_Table($Table4, 0x555555) GUISetState(@SW_UNLOCK) for $x = 1 to 8 for $y = 1 to 6 _GUICtrl_OnHoverRegister($Table4[$x][$y], "_Hover_Func", "_Hover_Func") Next Next Do;----- Loop ----- Sleep(10) $m = MouseGetPos() Until GUIGetMsg() = -3 Func _Hover_Func($iCtrlID, $iParam) Local $sConsole_Data = "Hovered" Local $iLabel_Color = 0x00000FF;0x0000ff Local $iLabel_FontAttrib = 4 Local $iTable1_highlight_Color1 = 0xFFD700 Local $iTable1_highlight_Color2 = 0xFFD700 If $iParam = 2 Then ;Indicates On *Leave* Hover process $sConsole_Data = "NOT Hovered" $iLabel_Color = 0x0000ff $iLabel_FontAttrib = 0 $iTable1_highlight_Color1 = 0xFFFFFF $iTable1_highlight_Color2 = 0xDDDDDD EndIf Printf("Control " & $iCtrlID & " [Data: " & GUICtrlRead($iCtrlID, 1) & "] Is Now " & $sConsole_Data) Switch $iCtrlID Case $LbCreateCode GUICtrlSetColor($iCtrlID, $iLabel_Color) GUICtrlSetFont($iCtrlID, 10, 400, $iLabel_FontAttrib) Case $Table4[2][1] _GUICtrlTable_Set_CellColor_Row($Table4, 2, $iTable1_highlight_Color1) Case $Table4[3][1] _GUICtrlTable_Set_CellColor_Row($Table4, 3, $iTable1_highlight_Color2) Case $Button _GUICtrlTable_Set_CellColor_Row($Table4, 2, $iTable1_highlight_Color1) EndSwitch EndFunc Func Printf($Str, $Line=@ScriptLineNumber) ConsoleWrite("!===========================================================" & @LF & _ "+======================================================" & @LF & _ "--> Script Line (" & $Line & "):" & @LF & "!" & @TAB & $Str & @LF & _ "+======================================================" & @LF) EndFunc I've modified the table example to be closer to my actual project, and I'm trying to hover the mouse over the rows in the table to highlight the entire row, regardless of which cell in the row I'm hovering over. in this example, hovering over the button gives the desired effect (as an example). I've also only coded looking specifically at 2 cells for now, to highlight the entire row (I'll add more later if I can get this to work). Thoughts? and thanks in advance. I LOVE AutoIT and this community!!!
-
Guys, First, I know this post is now 2 years old. I also think no further dev has been done on AutoIT for quite some time (not been following beta's though), of which I don't understand, because I LOVE this application! Water, you have been the inspiration for many of my applications as I don't know who this is "Bob Anthony, rewritten by water", but I know I've used this one, the excel one, and Dales IE one ALOT! so thanks all you guys. and in the almost 6 years now of writing apps for myself and my team at work, I just have been having a ball! Most of all, the help this forum gives has been great! (OK, I'll stop praising now...). But yes, I have finally hit that limitation, so I'll have to try to work in this "work around" now. it totally caught me off guard. I have a template where I "Moosh" many documents into 1, and in the header, I put a title section of who contributed (authored) those text blurbs. typically it is only 1 or 2, but the other day I saw 10 different folks, which meant the "header" text got too large, and failed (took a lot of time to figure out why after running it through 100 or so documents). I saw the error 3, but that's all, it didn't say exactly why. but searching here and finding this now, is excellent, as I'll be able to work this into my code (I hope). Thanks Jefrey for the work around. My question for water is, though, which would be faster? using his workaround, or adding in a different type of workaround, using the search range function, changing the range based on the part of text you copy in (255 at a time), and keep increasing the range start/end until you've copied in all the text? for example: $vRange = $oDoc.Parent.Selection.Range $vRange.paste() $vRange.MoveStart($iStartUnit, $iStartCount) $vRange.MoveEnd($iEndUnit, $iEndCount) $vRange.paste() This is by no means complete code, I'm just referencing other sections of your "_Word_DocRangeSet" Function, to outline maybe a faster way to write out the text (by moving the range selected?) Thanks!
-
Unable to set value of IE Form element
kalel69 replied to Jewtus's topic in AutoIt General Help and Support
From what I can see, your one example would work if you update the get object to use the form object instead of the IE object... you posted this... Local $oIE_open = _IECreate("http://localhost:1234") Local $oIE=_IEFrameGetCollection($oIE_open, 1) $o_form = _IEFormGetObjByName($oIE, "form_auth") $o_login = _IEFormElementGetObjByName($oIE, "usuario") $o_password = _IEFormElementGetObjByName($oIE, "password") ; Set field values and submit the form _IEFormElementSetValue($o_login, $saved_un1) _IEFormElementSetValue($o_password, $saved_pw1) But instead, try this... Local $oIE_open = _IECreate("http://localhost:1234") Local $oIE=_IEFrameGetCollection($oIE_open, 1) $o_form = _IEFormGetObjByName($oIE, "form_auth") $o_login = _IEFormElementGetObjByName($o_form, "usuario") $o_password = _IEFormElementGetObjByName($o_form, "password") ; Set field values and submit the form _IEFormElementSetValue($o_login, $saved_un1) _IEFormElementSetValue($o_password, $saved_pw1) Also, While this would definately fix the form element object call because you did not point it to the form object, it won't fix the fact that the form object itself is still "unknown". so you will have to figure out with frame to attach these calls too. I've had this every issue myself, and still have it on some cases, still seeking assistance, but in this case, you have to point it to the proper frame, or it won't work. I have a little sub function I use to get frame and form. (if you know their names)... Func _GetFF(ByRef $o_objectHWND,$o_IFrame,$o_Form) Local $oIE1,$oIFrame1,$oForm1 $Count = 0 Do $Count+=1 $oIE1 = _IEAttachHWND($o_objectHWND) Sleep(300) If $Count > 25 Then MsgBox(0,$FTMerror1,$FTMerror2) Return SetError($_IEStatus_NoMatch, 1, 0) EndIf Until IsObj($oIE1) Sleep(300) $Count = 0 Do $Count+=1 $oIFrame1 = _IEFrameGetObjByName($oIE1, $o_IFrame) If @error Then Return Sleep(300) If $Count > 25 Then MsgBox(0,$FTMerror1,$FTMerror2) Return SetError($_IEStatus_NoMatch, 2, 0) EndIf Until IsObj($oIFrame1) Sleep(300) $Count = 0 Do $Count+=1 $oForm1 = _IEFormGetObjByName($oIFrame1, $o_Form) If @error Then Return Sleep(200) If $Count > 20 Then MsgBox(0,$FTMerror1,$FTMerror2) Return SetError($_IEStatus_NoMatch, 3, 0) EndIf Until IsObj($oForm1) sleep(300) Return SetError($_IEStatus_Success, 0, $oForm1) EndFunc Here I send the frame name and form name down to the function, then I have a form object to use. might not be the best way, but for my company's site, as sluggish as it is, I had to code in the "Do...Until" to keep trying. oh, and the _IEAttachHWND($o_objectHWND) is just a custom quick from of IEattach, but this one only attaches by the hwnd item. so you can substitute IEAttach there, and use the hwnd of the IE object and use the comma ,"hwnd". Hope some of this helps or makes sense. Thanks. -
I do appreciate the reply. just so you know, it is commented because I have tried both methods. when I use IEFormElementSetValue, it grays the text. when I REM out IEFormElementSetValue, and only use send (with focus), it works, but only for the iecreate. not with ieattach. I can't get ieattach to work either way. I may try, as you mentioned, a combination of both when I get home. I will post back later. thanks again for the response! <got home> Tried the fix from Shane0000 (thanks). and it fixed item number 1, although I also added an additional line of text, because I now noticed for some reason, there are 2 input's for the password ("PasswordDisplay" and "Password"). So I went ahead and sent the password to both using the fix from Shane0000, and it works for item number 1 now, without having to use the "send" command. I'm excited about that! Func _LaunchAdminApp () If $CurServNam= "" Then Return If WinExists("PCDS :: Management") Then Return Local $FTMAddress= "https://"&$CurServNam&"/admin" If NOT WinExists("Fluency for Imaging Log On") Then Local $oIE = _IECreate($FTMAddress) Else Local $oIEWhnd = WinGetHandle("Fluency for Imaging Log On") Local $oIE = _IEAttach($oIEWhnd) EndIf Local $Count = 0 If $AdmAutoLogin = 1 Then If $LoginIDAA = "" Then Return Do $Count+=1 Sleep(200) If $Count > 30 Then MsgBox(0,"Sorry","Can't sign in to Admin App!") Return EndIf Until IsObj($oIE) Local $oForm = _IEFormGetCollection($oIE,0) $Count = 0 Do $Count+=1 Sleep(200) If $Count > 30 Then MsgBox(0,"Sorry","Can't sign in to Admin App!")5 Return EndIf Until IsObj($oForm) WinActivate($oIE) Local $oQueryUser= _IEFormElementGetObjByName ($oForm, "UserName" ) Local $oQueryPW1 = _IEFormElementGetObjByName ($oForm, "PasswordDisplay" );where did this come? - <input id="PasswordDisplay" Local $oQueryPW2 = _IEFormElementGetObjByName ($oForm, "Password" ); - <input id="Password" Local $CompID = _IEFormElementGetObjByName ($oForm, "Domain" ) Local $oSubmit = _IEFormElementGetObjByName ($oForm, "loginBtn" ) Sleep(500) _IEAction ($oQueryUser,"focus" ) _IEAction ($oQueryUser,"selectall" ) Sleep(500) ;Send ($LoginIDAA );this will work only for initial login, not for subsequent log in's after logoff. _IEFormElementSetValue ($oQueryUser, $LoginIDAA );this does not work. enters name in gray text, app does not think its there, but can see it. _IEAction ($oQueryPW1, "focus" ) _IEAction ($oQueryPW1, "selectall" ) Sleep(500) ;Send ($PasswordAA );this will work only for initial login, not for subsequent log in's after logoff. _IEFormElementSetValue ($oQueryPW1, $PasswordAA );this does not work. enters password in gray text, app does not think its there, but can see it. _IEAction ($oQueryPW2, "focus" ) _IEAction ($oQueryPW2, "selectall" ) Sleep(500) _IEFormElementSetValue ($oQueryPW2, $PasswordAA ) _IEAction ($CompID, "focus" ) Sleep(500) _IEFormElementOptionSelect ($CompID,0,1,"byIndex" ) Sleep(500) If IsObj($oSubmit) Then $oSubmit.click() EndIf If $CloseAfSelAA = 1 Then Exit EndFunc Thanks. 1 down. 2 to go! Still won't re-login after logging out. (item 2 above). and still nothing from the .hta app (that uses the same code as the web page). Any further assistance would be greatly appreciated. Please don't forget I've attached screenshots in a zip, and the .html code page for the login page. Thanks again!
- 2 replies
-
- Internet Explorer 9
- windows 7
-
(and 1 more)
Tagged with:
-
Hi Folks. Looking for a little assistance to help login to one of my company's application's web pages. These are Intranet based pages, and not open to the general public, and I will try to provide the code and screen shots where I can. I have been attempting to get this login script to work for quite some time. Any help would be appreciated. I have 3 types of issues here. 1. using the basic _IEFormElementSetValue, instead of replacing the grayed out verbiage (user name) with an un-grayed out text (actual user name in black type font), it does enter the user name, but it is entered still as grayed out text in the input box. 2. to get the above to work, i've replaced using _IEFormElementSetValue and instead use an "_IEAction" (2 actually - focus / select all) then a "send" to manually put in the username. This works upon initial launch of the page, but when logged out, and logging back in, the IEactiion and send fail to enter the fields. 3. My company has an .hta application that launches a reporting app, but the page is designed exactly the same as the web page, (except the app contains the code - the .hta app), but it is still the exact same fields defined. Theoretically knowing the input boxes names as I do and that they're the same, I should be able to log into this app the same way. However, I can not. I once contacted dale through email to question why the .hta app would not respond, and he gave me some ideas, and stated if I still have issues, to post a topic here. so this is what I'm doing, because I still have issues with the .hta app. And I've also tried to attach to the .hta application as an embedded application, but still could not get the fields to populate (log in screen). I have attached screen shots of the intial view of the sign on page, and the view of an attempted signon using _IEFormElementSetValue. Here is my code to attempt to attach / launch-create the web page. Func _LaunchAdminApp () If $CurServNam= "" Then Return If WinExists("PCDS :: Management") Then Return Local $FTMAddress= "https://"&$CurServNam&"/admin" If NOT WinExists("Fluency for Imaging Log On") Then Local $oIE = _IECreate($FTMAddress) Else Local $oIEWhnd = WinGetHandle("Fluency for Imaging Log On") Local $oIE = _IEAttach($oIEWhnd) EndIf Local $Count = 0 If $AdmAutoLogin = 1 Then If $LoginIDAA = "" Then Return Do $Count+=1 Sleep(100) If $Count > 30 Then MsgBox(0,"Sorry","Can't sign in to Admin App!") Return EndIf Until IsObj($oIE) Local $oForm = _IEFormGetCollection($oIE,0) $Count = 0 Do $Count+=1 Sleep(100) If $Count > 30 Then MsgBox(0,"Sorry","Can't sign in to Admin App!")5 Return EndIf Until IsObj($oForm) WinActivate($oIE) Local $oQueryUser= _IEFormElementGetObjByName ($oForm, "UserName" ) Local $oQueryPW = _IEFormElementGetObjByName ($oForm, "PasswordDisplay") Local $CompID = _IEFormElementGetObjByName ($oForm, "Domain" ) Local $oSubmit = _IEFormElementGetObjByName ($oForm, "loginBtn" ) Sleep(500) ;_IEAction ($oQueryUser,"focus" ) ;_IEAction ($oQueryUser,"selectall" ) ; Send ($LoginIDAA );this will work only for initial login, not for subsequent log in's after logoff. _IEFormElementSetValue ($oQueryUser, $LoginIDAA );this does not work. enters name in gray text, app does not think its there, but can see it. ;_IEAction ($oQueryPW, "focus" ) ;_IEAction ($oQueryPW, "selectall" ) ; Send ($PasswordAA );this will work only for initial login, not for subsequent log in's after logoff. _IEFormElementSetValue ($oQueryPW, $PasswordAA );this does not work. enters password in gray text, app does not think its there, but can see it. _IEFormElementOptionSelect ($CompID,0,1,"byIndex" ) Sleep(5000) If IsObj($oSubmit) Then $oSubmit.click() EndIf If $CloseAfSelAA = 1 Then Exit EndFunc Basically, i'm checking to see if the pages exists first, then either creating a page or attaching to a page depending upon the results of the check. I've also attached the source for the signon page for the web app. Note that the code delivered via the .hta for sign on is exactly the same. any and all suggestions are most welcome. I'm at my witts end here! Thanks in advance! (I love AutoIT! and this site!) view of signon screens.zip Company Application Signon Page.html
- 2 replies
-
- Internet Explorer 9
- windows 7
-
(and 1 more)
Tagged with:
-
SciTE folding settings by level?
kalel69 replied to shEiD's topic in AutoIt General Help and Support
2 year old post, but I have the same issue. Here is my solution... Read the last entry by me. It works to close those functions under the selected region. I've also updated it to fold the function descriptions if they're based on the IE.au3 format as well! Just wish there was a faster/cleaner solution. Thanks, -
Collapse all SciTe Folds Hotkey
kalel69 replied to exodius's topic in AutoIt General Help and Support
@ BitByteBit Same here, but thanks for your post. I also have added to a 2 year old post, in hopes someone can either use this information, or clean it up and improve upon it. #NoTrayIcon HotKeySet("!`", "HowDidINotThinkOfThisSooner") HotKeySet("!1", "_ToggleSelectedregionsInnerFolds") HotKeySet("!0", "_Exit") Opt("WinTitleMatchMode", 2) While 1 Sleep(1000) WEnd Func HowDidINotThinkOfThisSooner() WinMenuSelectItem("SciTE", "Source", "&View", "Toggle &all folds") EndFunc ;==>HowDidINotThinkOfThisSooner Func _ToggleSelectedregionsInnerFolds() Local $FuncNotes = "; #FUNCTION#",$Look4FuncNotes = 0 $SciTEHWND = WinGetHandle("SciTE", "Source") $Temp = WinGetTitle($SciTEHWND) ConsoleWrite($Temp&@CRLF) $Temp1= StringSplit($Temp," - SciTE ",3) If @error Then Return $SciTEtitle = $Temp1[0] $FileOpen = FileOpen($SciTEtitle,0) If $FileOpen = -1 Then Return $FileRead = FileRead($FileOpen) FileClose($FileOpen) ClipPut("") WinActivate($SciTEHWND) Send("{HOME}") Send("+{END}") Send("^c") $Region = ClipGet() $Temp = StringInStr($FileRead,$Region,0) If @error then Return $Temp1 = StringTrimLeft($FileRead,$Temp-1) $Temp2 = StringInStr($Temp1,"#endregion",0) $FoundRegion = StringLeft($Temp1,$Temp2+10) ConsoleWrite($FoundRegion&@CRLF) $Count = 0 Do $Temp = StringInStr($FoundRegion,"EndFunc",2,$Count+1) If $Temp = 0 Then ExitLoop $Count+=1 ConsoleWrite("Found End function "&$Count&" here: "&$Temp&@CRLF) Until 1<>1 If $Count = 0 Then Return $Look4FuncNotes = StringSplit($FoundRegion,$FuncNotes,1) If @error then $Look4FuncNotes = 0 Else $Look4FuncNotes = 1 EndIf ConsoleWrite("Found "&$Count&" Functions "&@CRLF) WinActivate($SciTEHWND) Send("{HOME}") Send("{DOWN}") WinMenuSelectItem($SciTEHWND,"","&Search","&Find") Send("EndFunc") Send("{ENTER}") For $x=1 to $count WinMenuSelectItem("SciTE", "Source", "&View", "Toggle ¤t fold") Send("{HOME}") Send("{UP}") Send("{DOWN}") Send("{DOWN}") If $x <> $count Then Send("{F3}") Next If $Look4FuncNotes = 1 Then WinActivate($SciTEHWND) Send("^{HOME}") WinMenuSelectItem($SciTEHWND,"","&Search","&Find") Send("{#}"&StringTrimLeft($Region,1)) Send("{ENTER}") Send("{HOME}") Send("{DOWN}") WinMenuSelectItem($SciTEHWND,"","&Search","&Find") Send("; {#}FUNCTION{#}") Sleep(300) Send("{ENTER}") Send("{HOME}") For $x=1 to $count WinMenuSelectItem("SciTE", "Source", "&View", "Toggle ¤t fold") Send("{HOME}") Send("{DOWN}") If $x <> $count Then Send("{F3}") Send("{HOME}") Next EndIf EndFunc Func _Exit() Exit EndFunc ;==>HowDidINotThinkOfThisSooner a few caveats: - I use regions to help sort through my code. If you use regions, put a name after the region of what that region contains. For this to work, they should all be different region names. - Save your work before calling the hotkey. (good practice anyway), as the code will read your file to do the searching. (it will discover how many functions are contained in the region to toggle). - Put your cursor anywhere on the desired #Region name where you want to toggle closed the below functions. Press the hotkey Alt 1 I find this very helpful, when you toggle ALL folds, and still want to drill down to a particuar function within a region. unfortunately, I don't know if there is a setting to auto fold these, so when you do the ALL, and then open a region, those functions are all expended. This utility add on will close all the folds for you only withhin the selected region. -
Script Pauses when IE Popup Opens
kalel69 replied to GoldenMike's topic in AutoIt General Help and Support
Dale, Thanks. Your suggestion of looking at the second example worked perfectly for me. I did realize the example needs to be updated for IE9. So I did that as well. I also know this post is a bit old, but I wanted to let folks know that if you have that issue, Dales suggestion does solve it. Thanks! -
This is AWESOME!!! Great Job, and Thanks for all the hard work you've been putting into this app, and thanks for sharing it!
- 995 replies
-
- isn autoit studio
- isn
-
(and 3 more)
Tagged with:
-
Water, are you in a bad mood today? Why are you totally dis'sing my post without knowing the facts about it? YOU are the one who totally ignored my previous post. It twas not a topic I created, rather than a reply under someone else post. I started by saying it was "a bit off topic but similiar", and NO ONE offered a peice of advice for me, rather just went on about that topic. check out this... I am not asking for immediate repsonse, rather a newbie poster (9 posts here), and this is how you treat the newbies? I don't want to start a flame war, i'm simply lookilng for help, and maybe the first place I posted this was the wrong place. So I posted it here instead. Thanks for understanding. But no thank you for the help. Can someone ELSE please look at this?
-
I asked this question in another post, but everyone ignored it, so I will ask it here in a new post... sorry for the redundency... I have a web page that is slow to load at times, and I work in frames. I've tried _LoadWait, but it returns before all the frames load, and the objects don't get created because it can't find the paths to the objects within the frames. If I put just sleep commands in it works but takes too long. I'd like it to return to the user after the page loads 100 % completely and my commands don't fail. I've been doing it by checking isobj() $Count = 0 Do $Count+=1 $oIE = _IEAttachHDL($DQMwHndl) Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oIE) This works, but takes up CPU time checking a lot until the page loads. ($DQMwHndl is the handle to the IECREATE(web address) - _IEAttachHDL is a shorned version only using HWND's) After the attach, I have to check for the frame, and form, using the same logic, or sometimes my script fails, as it cant get past all that stuff. The short version: $oIE = _IEAttachHDL($DQMwHndl) $oIFrame = _IEFrameGetObjByName($oIE, "ifmPage") $oForm = _IEFormGetObjByName($oIFrame, "frmADT") $oSubmit = _IEGetObjByName($oForm, "button2") $oSearchCompID = _IEFormElementGetObjByName($oForm, $CompanyPicker) _IEFormElementSetValue($oSearchCompID,$ClientFacility) _IEAction($oSubmit, "click") the long version is what works, with each line above having a loop to check IsObj(). Basically because _loadwait() really doesn't work well. So each time I click a link, i have to verify all the objects again. Func _ADTDefs() If WinExists($DQMwHndl) Then $oIE = _IEAttachHDL($DQMwHndl) _IELinkClickByIndex ($oIE, $ClickADTDefSearch);link 43 search ADT defs. Sleep(200) $Count = 0 Do $Count+=1 $oIE = _IEAttachHDL($DQMwHndl) Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oIE) Sleep(200) $Count = 0 Do $Count+=1 $oIFrame = _IEFrameGetObjByName($oIE, "ifmPage") Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oIFrame) Sleep(200) $Count = 0 Do $Count+=1 $oForm = _IEFormGetObjByName($oIFrame, "frmADT") Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oForm) Sleep(200) $Count = 0 Do $Count+=1 $oSubmit = _IEGetObjByName($oForm, "button2") Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oSubmit) Sleep(300) $Count = 0 Do $Count+=1 $oSearchCompID = _IEFormElementGetObjByName($oForm, $CompanyPicker);this is the call that is failing... if @error then $Temp = 0;nothing Sleep(400) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oSearchCompID) Sleep(400) _IEFormElementSetValue($oSearchCompID,$ClientFacility) Sleep(500) _IEAction($oSubmit, "click") EndIf EndFunc Is there a better way to make sure each object is a valid object other than what I preset here (too lengthy-not a clean script, too much CPU time) or a better way to ensure the page is really loaded instead of relying on LoadWait that will allow the short version to run properly? Thanks in Advance!
-
Question: A bit off topic but related... I have a web page that is slow to load at times, and I work in frames. So I have to check after an attach statement to see if it really attached. I've been doing it by checking isobj() $Count = 0 Do $Count+=1 $oIE = _IEAttachHDL($DQMwHndl) Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oIE)This works, but takes up CPU time checking a lot until the page loads. ($DQMwHndl is the handle to the IECREATE(web address) )After the attach, I have to check for the frame, and form, using the same logic, or sometimes my script fails, as it cant get past all that stuff.The short version: $oIE = _IEAttachHDL($DQMwHndl)$oIFrame = _IEFrameGetObjByName($oIE, "ifmPage")$oForm = _IEFormGetObjByName($oIFrame, "frmADT")$oSubmit = _IEGetObjByName($oForm, "button2")$oSearchCompID = _IEFormElementGetObjByName($oForm, $CompanyPicker)_IEFormElementSetValue($oSearchCompID,$ClientFacility)_IEAction($oSubmit, "click")the long version is what works, with each line above having a loop to check IsObj(). Basically because _loadwait() really doesn't work well. So each time I click a link, i have to verify all the objects again. Is there a better way to make sure each object is a valid object other than what I preset here (too lengthy-not a clean script, too much CPU time) Thanks!
-
MOST EXCELLENT! I've already tried and tested, as you know golfinhu, this one: _ExcelReadSheetToArrayEX($oExcel, $iStartRow = 1, $iStartColumn = 1, $iRowCnt = 0, $iColCnt = 0, $iColShift = 0) Its extremely fast, 10 x 's as fast actually, if not faster, and works GREAT! I'm not sure what corners you cut to increase the time, but man, it produces the same results, and 1000x faster! I use it most every one of my apps I build for work. I can't think you enough. As you know, I requested you to do the same with the_ExcelWriteSheetFromArrayEx But this is even better. So many newer faster functions to play with. I can't wait to get my hands on them! Its like its my birthday! As soon as I get a chance to test the new ones above, I'll post back here and let you know. Thanks again!
-
Is there no help for this issue? I also have been using AutoIT for a few years, and have developed lots of GUI's based on it I share with my Co-workers. I love this product so much, I even donated to the cause! But this is a big issue for me, not being able to automate downloading a file. I've tried every solution I could find within the AutoIT forum, and nothing works. @ icu: I also am able to download what appears to be a solid file using InetGet(), however, when you open that file, it states "something is missing". then it opens in excel, and even excel asks you to log in. "no valid session. Please log in". I've not really seen that issue before, but I’ve not tried to automate downloading from a secure site in IE9 before. (HTTPS). @ NAflowers: Thanks for trying, but you are correct, and I can't use it if someone still has to manually click a link. @ JLogan3o13 Maybe InetGet isn't working properly for me, as I can't link it to my instance of $oIE that I used to _IECreate() and work within an iframe such as "ifmPage". Most of the calls to the links I have to do from within this iFrame page as it relates to $oIE. So just launching an InetGet() command doesn’t attach to my instance of IE. And yes, I've tried username:password@www.address" and InetGet still does not work. Another thread stated to use a better download manager than IE9's downloading, and it is more user friendly. I did download that, but it is a lot to ask of all my co-workers, to download and install this 3rd party download manager that is more "AutoIT Friendly". Yes, it is, and yes, I can get my scripts to work now on my development box. But again, I'm looking for some solution built within AutoIT itself. (self contained). And yes, I've downloaded the latest "Beta" and tried that, to no avail. Honestly, to me, it does not look like the Beta Version of IE.au3 has not been touched in some time: Again, I can't say how grateful I am someone has taken the time to develop this great utility! I'd be lost without it. But can't we please get support for IE9 Built into it? At least in the beta version? Note the version and the update and the tested/developed on IE6/7. Maybe this is a low priority, but I've seen enough threads about folks having various issues with IE9 that it should be at least put on the list to include in the next Beta version. Thanks in advance for any assistance!
-
In the previous post I posted my code for which you requested. Note I left some buttons for you to fill in as you please (you can add previous -page, or other items to the P or R buttons) Also this code will remember the last web site visted, and will show it in the input box when the app is re-opened. I use region commands to keep the areas separate for ease of troubleshooting the code. And it helps the the code nice and clean. If you toggle all folds (under View - in Scite) you can clearly the regions and what they are doing. Hope this helps...
-
#region Include #include <GuiStatusBar.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #Include <GuiToolTip.au3> #include <Process.au3> #include <IE.au3> #include <EditConstants.au3> #Include <GuiButton.au3> #include <WindowsConstants.au3> #include <String.au3> #endregion #region Set Options Opt('MustDeclareVars', 0) Opt("WinTitleMatchMode", 2) TrayTip("Click Tray Icon", "Click the Tray Icon to Pause the script at any time!", 5,1) #endregion $Ver = "1.0" #region Global Variables Global $Browser="IE",$WebPage="None",$UpdateMsg="Your Business" Global $aText[3] = [$UpdateMsg , $WebPage, $Browser] Global $aParts[3] = [100, 450, -1] Global $button_1, $button_2,$Go,$MainGUI,$hStatus,$InputWebsite,$fActivate,$label_1,$L1,$I1,$LastWebSite,$oIE #endregion #region Variables $oIE = "" $L1="Please enter web address - then press GO!" $I1="http://www." $LastWebSite = RegRead("HKEY_CURRENT_USER\Software\WebBrowser","LastWebSite") If $LastWebSite <> "" Then $I1 = $LastWebSite #endregion #region Main GUI create $MainGUI = GUICreate("Browser Ver."&$Ver, 500, 80,10,@DesktopHeight-140) GUISetBkColor(0xE0FFFF ) _GUIToolTip_Activate($MainGUI, $fActivate = True ) $hStatus = _GUICtrlStatusBar_Create ($MainGUI, $aParts, $aText ) $Go = GUICtrlCreateButton("Go",437,01, 20, 20, $BS_DEFPUSHBUTTON ) $button_1 = GUICtrlCreateButton("P", 458,01, 20, 20 ) $button_2 = GUICtrlCreateButton("R", 479,01, 20, 20 ) $label_1 = GUICtrlCreateLabel($L1, 10,10,230, 20 ) $InputWebsite= GUICtrlCreateInput($I1, 05,30,480, 20 ) #endregion #region Main Loop GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $button_1 Case $button_2 Case $Go _GoToSite() Case Else EndSwitch WEnd Exit #endregion ;Functions ---------------------------------------------------------------- Func _GoToSite() $LastWebSite=GUICtrlRead($InputWebsite) If $oIE = "" Then $oIE = _IECreate ($LastWebSite) Else _IENavigate($oIE,$LastWebSite) EndIf RegWrite("HKEY_CURRENT_USER\Software\WebBrowser","LastWebSite", "REG_SZ", $LastWebSite) EndFuncTry this: (first time trying to post some code, so sorry if it does not come out right)
-
_ExcelReadSheetToArrayEX() much faster than the original
kalel69 replied to golfinhu's topic in AutoIt Example Scripts
Oh My GOD! Not just a little, A LOT faster. This saves me hours on huge excel files. I wish I'd found it sooner. Thank you soooo much! Can you reverse it for time savings as well? WritesheetToArrayEX? That would be GREAT! Thanks, -
Well, after pouring over this many more hours, I did figure it out. Thanks for the help here though. Here was my solution, if anyone is interested: $oIE = _IEAttach("Project Tracking") $oFrame = _IEFrameGetObjByName($oIE, "ifmPage") $iframe = _IEFrameGetObjByName($oFrame, "ProjDetailFooter") $oForm=_IEGetObjById ($iframe, "footerform") $osubmit=_IEGetObjById ($oForm, "btn_pg3") _IEAction ($osubmit, "click") _IELoadWait ($oIE) apparently the frame "ifmPage" was holding 2 sub iframes. "ProjectDetailsFrame" and "projectDetailFooter". After I drilled down Deep enough, I was able to attach to the "notes" page (btn_pg3) Thanks again. I don't know what I would do without AutoIT !
-
Sorry, I was thinking about that also:--> IE.au3 V2.4-0 Warning from function _IEGetObjById, $_IEStatus_NoMatch (footerform) --> IE.au3 V2.4-0 Warning from function _IEGetObjById, $_IEStatus_NoMatch (btn_pg3) --> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType these are the errors, here are the attach statements: $oIE = _IEAttach("Project Tracking") $oIFrame = _IEFrameGetObjByName($oIE, "ProjectDetailFooter") $oForm=_IEGetObjById ($oIFrame, "footerform") $osubmit=_IEGetObjById ($oForm, "btn_pg3") _IEAction ($osubmit, "click") _IELoadWait ($oIE) I believe the main html has 3 frames. Main, ifmPage for the project details (this I'm sure of cause it works in here), and the ProjectDetailFooter, but that is the one I can't seem to attach to. I've tried may combinations of frame/form, but nothing for the footer buttons. I just want to be able to press a button to move it to another page view. Nothing to submit, just press the button. I have tried to search for button text, Links in the footer, i can't find anything. I used a developer tools in IE9 to catch the scripts and I can view each frame of scripts independently. I have looked at the source and found the info I needed, such as btn_pg3 in the footer, and the footer form being called "footerform". the problem is I can the autoIT attach to the frame used by footerform, which I believe is called "projectDetailFooter" iframe, but I am not 100% sure of that, and even using the developer tools in IE I can not clearly say it is the frame I need to attach too. Thanks for your previous quick reply! it is most appreciated.
-
Hi Folks. I've tried everything I can think of to get to click one button on a secure webpage I use for work. Unfortunately because its secure I can not share the page. but I can give as much information about it as I can. WinActivate("Project Details") $oIE = _IEAttach("Project Details") $oIFrame = _IEFrameGetObjByName($oIE, "ifmPage") $oForm = _IEFormGetObjByName ($oIFrame, "frmUsers") $oQueryUser = _IEFormElementGetObjByName ($oForm,"login") $oSubmit = _IEFormElementGetObjByName ($oForm,"button1") _IEFormElementSetValue ($oQueryUser, $PhysToUpdateAndDisable) _IEAction ($oSubmit, "click") _IELoadWait ($oIE) This is how I can access most forms. Even within Iframes. however, sometimes its hit or miss. Most of my forms are contained in a frame call "ifmPage". So instead of attaching to the IE object, I attach to the frame object, and that usually works. However, at the bottom of the page, are addition buttons, java scripted, they are not in ifmPage, and I can not find the frame the footer is in. I used the get frame collections, and still could not get it. I've tried to view all the source code I can grab, but still no mention of other frames. I know its in the footer, but I can not attach to what ever that frame is called, so I can't grab the form objects which are clearly labeled in the code in the standard format. $oIFrame = _IEFrameGetObjByName($oIE, "ProjDetailFooter"); NOPE - can't find this iframe oForm = _IEFormGetObjByName($oIFrame, "footerform") ; can't see this form when pointed to ifmpage! Any Ideas? I love this program by the way! Thanks in Advance!