Sign in to follow this  
Followers 0
ecrain

_IE Function Gets Stuck in Internal Loop

6 posts in this topic

Local $oIE = _IECreate("mylink...removed for security")
_IELinkClickByText($oIE,"FileName",0,0) ; final parameter states to NOT wait for webpage to open
WinWaitActive("Open Document") ; Download box
Call("_LoopSend",2,"{DOWN}") ; Custom function loops a key press, in this case DOWN twice. Selects Edit
Send("{TAB}",0) ; Move to OK/Cancel buttons
Send("{ENTER}",0) ; Hit OK

Above is an abridged version of my script. After opening IE and correctly opening the download box in SharePoint (download box says "Read," "Edit," "OK," "Cancel"), it gets stuck. The script does not move on to the third line. 

I know it's in a loop because I can't use my hotkey (not shown) to stop the script. Why is it getting stuck and how do I unfreeze it? Is it because it opens a download box and not a webpage?

Thanks for your help,

ecrain

Share this post


Link to post
Share on other sites



Are you sure it's not stuck on the third line? Seeing as how that line is going to wait until it finds the correct window, I would verify where you're getting stuck by putting in some error checking and consolewrites. Right now you can't tell anything about what's going on.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for the reply. I've checked by including a message box before the WinWaitActive command... it never appeared. If there is a better way to check, let me know.

EDIT: I doubt it helps, but I had this same problem with $oExcel = ObjGet("", "Excel.Application"). I solved it by placing this $oExcel = ObjCreate("Excel.Application") further up in the code.

Edited by ecrain

Share this post


Link to post
Share on other sites

Maybe >this thread will get you pointed in the right direction.

Share this post


Link to post
Share on other sites

Check out the second example for _IEAction for a workaround.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Thanks for your posts. I now understand why it is happening (the popup). 

Dale, I've been working on the workaround. I can't figure out how to make the text "FileName" to be recognized by _IEAttach. See below. Can you assist?

; From the example

Local $oIE = _IE_Example("form")
Local $oSubmit = _IEGetObjByName($oIE, "submitExample") ; <-- I need $oSubmit to somehow equal the object/something for the text "FileName" or something like that. I've tried ByName, ID, ReadText, OptionSelect, etc., to no avail.
Local $hwnd = _IEPropertyGet($oIE, "hwnd")
_IEAction($oSubmit, "focus") ; So that it can be "focused" here.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0