sbobbyyy Posted October 16, 2012 Posted October 16, 2012 Hello,I need to upload an attachment and send a mail with that attachment.I am working on IE.The following is the script i used to do so.#include <IE.au3>; Internet Explorer is partly integrated in shell.application$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object$oShellWindows=$oShell.windows ; Get the collection of open shell Windows$MyIExplorer=""for $Window in $oShellWindows ; Count all existing shell windows ; Note: Internet Explorer appends a slash to the URL in it's window name if StringInStr($window.LocationURL,"https://......") then $MyIExplorer=$Window ;MsgBox 'IE Select'; exitloop endifnext$frame = _IEFrameGetObjByName($MyIExplorer, "right")$oForm = _IEGetObjByName ($frame, "attachfile")MsgBox(0, "Test","Clicking button")_IEAction($oForm, "click")WinActivate("Choose file to Upload");;WinWaitActive("Choose File to Upload");WinFlash("Choose file to Upload", "",4,500)MsgBox(0, "Test","Selected window")ControlSetText("Choose File to Upload", "", "Edit1", "D:\screenshots\test.jpg")Sleep(1000)ControlClick("Choose File to Upload" ,"", "Button2")ExitThe problem is "Choose file to Upload " window is opened but the remaining part of the script is not getting executed..I mean... the below piece of code is not getting executed. It is waiting for a long time.WinActivate("Choose file to Upload");;WinWaitActive("Choose File to Upload");WinFlash("Choose file to Upload", "",4,500)MsgBox(0, "Test","Selected window")ControlSetText("Choose File to Upload", "", "Edit1", "D:\screenshots\test.jpg")Sleep(1000)ControlClick("Choose File to Upload" ,"", "Button2")ExitPlease help me out in resolving this issue.Thank you,Bhaskar
xjiang Posted October 24, 2012 Posted October 24, 2012 Do you have an answer? I met this question too.
stormbreaker Posted October 24, 2012 Posted October 24, 2012 (edited) Yo, using ControlClick.... eh? You can't do something like that for a webpage. Try this one from Jos: Edited October 24, 2012 by MKISH ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now