
aviaf
Members-
Posts
18 -
Joined
-
Last visited
aviaf's Achievements

Seeker (1/7)
0
Reputation
-
I set up an If statement inside of an Elseif statement, is this allowed/possible? I want it to test first case, if yes, then it goes to end if, if not, then it goes to the other if statement wher eits tested for the second case, if yes, then to endif, if not, then to else, then end if. Code: If (WinGetHandle("McMaster University UTS Student Applications - Windows Internet Explorer"))= $start Then sleep(300) ElseIf If WinActive("Mugsiseat failed - Windows Internet Explorer" Then WinClose("Mugsiseat failed - Windows Internet Explorer") Else WinClose("McMaster University UTS Student Applications - Windows Internet Explorer") WinActivate("McMaster University UTS Student Applications - Windows Internet Explorer") _IELinkClickByIndex ($browser, 3) EndIf EndIf Until (WinActive ("FIPPA Notice - Windows Internet Explorer")) Any ideas? EDIT: Whoops figured it out, had to use the Else to declare the new If statement in.
-
thanks! I should have realized
-
I have the following code: _IELinkClickByIndex ($browser2,8) done() Func done() GUICreate("GUI",300, 100, 15, 15) GUISetState() GUISetBkColor(0x00FF00) GUISetFont(42) GUICtrlCreateLabel('Done!', 75,20) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Continue loop untill window is closed Exit EndFunc Sleep(2000) All of this is within another func just fyi. When I run it, it says: "Func" statement has no matching "EndFunc".: Func done() What did I do wrong?
-
I want autoit to creat and write to a file in its local directory, but the command requires a directory, how do I do this? EDIT: Nevermind, figured out you jsut write out a filename with no directory.
-
So I moved the Endif down, but now it says: (73) : ==> "Else" statement with no matching "If" statement.: Else Which is referring to the Else in the middle of that If statement While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $EncryptButton GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything $string = GUICtrlRead($EditText) ; Saves the editbox for later GUICtrlSetData($EditText, 'Please wait while the program is activated.') ; Friendly message $stringdecrypt = _StringEncrypt(0, $string, "dumitru", 1) IF $stringdecrypt = $pass Then MsgBox (0,"Activated" , "Code is good") $program = 1 Else MsgBox (0, "Incorrect", "Incorrect code Please Reenter") GUICtrlSetData($EditText, $string) EndIF ; Calls the encryption. Sets the data of editbox with the encrypted string ; The encryption starts with 1/0 to tell it to encrypt/decrypt ; The encryption then has the string that we saved for later from edit box ; It then reads the password box & Reads the level box GUISetState(@SW_ENABLE, $WinMain) ; This turns the window back on EndSwitch WEnd ; Continue loop untill window is closed Exit EndFunc ;==>_Main OOps, nevermind, the else was off by a tab, moved it, its fine. Thanks guys, that was super quick help!
-
I started off with the exmaple script from the Encryptstring helpfile and editted by adding an If, then, else, endif statement. But now when I run the script, it says: "EndSwitch" statement with no matching "Switch" statement.: EndSwitch If I take the whole If--> endif portion out of the code, then it works, what am I doing wrong, how am I interfereing with the case and how do I fix it? Portion of code which is the problem is below: While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $EncryptButton GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything $string = GUICtrlRead($EditText) ; Saves the editbox for later GUICtrlSetData($EditText, 'Please wait while the program is activated.') ; Friendly message $stringdecrypt = _StringEncrypt(0, $string, "password", 1) If $stringdecrypt = $pass Then MsgBox (0,"Activated" , "Code is good") $program = 1 Else MsgBox (0, "Incorrect", "Incorrect code Please Re-enter") GUICtrlSetData($EditText, $string) EndIF ; Calls the encryption. Sets the data of editbox with the encrypted string ; The encryption starts with 1/0 to tell it to encrypt/decrypt ; The encryption then has the string that we saved for later from edit box ; It then reads the password box & Reads the level box GUISetState(@SW_ENABLE, $WinMain) ; This turns the window back on EndSwitch WEnd ; Continue loop untill window is closed Exit EndFunc ;==>_Main
-
Yes! I got it to work with the ieclickbyindex! So glad I got it working, and although I didn't get any replies here, it actually helped to post here and think it out. Plus all the other examples on the site helped too.
-
ok, so aside from the question above of why I can't use the title of the page in ieattach properly, i did figure out how to click the button on the existing page. but now i have another javascript question: There is a new list of javascript items, and the item I want to click on does not have a simple name like the one above which had "mybutton" Here is the info on the list item: <TR><TD VALIGN="TOP" CLASS="x12"><LI><A STYLE="text-decoration:none;color: #800000;font: 10pt Helvetica Condensed; font-weight: bold;" href="javascript:void(0)" onclick="submitFormWin('H002','MW1','mugsi')">SOLAR and other tabel/list options also have a class of "x12"
-
ok, so rather than use the tile of the page, i used the text method using the first bit of text in the page to get ie attach to work, but why didn't it work with using the title?
-
ok, so now i've done this: WinWaitActive("[CLASS:IEFrame]") #include <IE.au3> $oIE = _IEAttach ("FIPPA Notice - Windows Internet Explorer") $oForm = _IEGetObjByName ($oiE, "mybutton") _IEAction ($oForm, "click") But now it tells me that : --> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch --> IE.au3 V2.4-0 Error from function _IEGetObjByName, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType >Exit code: 0 Time: 2.532
-
Ok, So I've used autoit here and there over the past two years, but I get confused when looking even at the help file or at other exmples for things like the IEAction. I'm trying to get autoit to click on a button which uses javascript in the page. This is the info about the button : <input type="button" onclick="return SubmitTheForm();" value="Continue" name="mybutton"> What do I enter into my autoit script to click on that button no matter where it appears on the screen? Sorry, I know this must seem like a simple question but I can't figure out what to put in. Also, I'm confused by the example saying: #include <IE.au3> $oIE = _IE_Example ("form") $oSubmit = _IEGetObjByName ($oIE, "submitExample") _IEAction ($oSubmit, "click") _IELoadWait ($oIE) Should _IE_Example be replaced by my Title of my browser page? What else changes to what? uhh, any help would be great. Thanks.
-
I want the mouse to click an apply settings button, and then click continue and then click on another tab in firefox, however the time for the settings to apply and click conitnue may differ and i dont want to lose time by making a long delay so i want it to click apply, then click continue, and if the site then goes to settings to click another tab, but if it clicked too quickly and its still at continue , then to delay 5 sec, and click at continue coordinates then click another tab, here's my coding so far: MouseClick ( "left" , 635, 355 , 1 ) If WinActive( Basic Setup - Mozilla Firefox ) Then MouseClick ( "left" , 125, 115 , 1 ) Endif If WinActive( Mozilla Firefox ) Then Sleep(5000) MouseClick ( "left" , 635, 355 , 1 ) MouseClick ( "left" , 125, 115 , 1 ) EndIf But it says error parsing function call, how do i fix it?
-
I fell like such a dummy, but what do i add to a script to make it scroll the current window (i.e. a long webpage) to the bottom? I looked at those tutorials SmOke N posted for me but couldn't find this k, i just ended up using multiple {down} commands