cypher175 Posted November 17, 2009 Posted November 17, 2009 How would I use AutoIt to upload a picture to here..?? http://img.4chan.org/b/imgboard.html
jvanegmond Posted November 17, 2009 Posted November 17, 2009 Use mouse clicks and keyboard input. You can't with IE8 DOM. github.com/jvanegmond
cypher175 Posted November 17, 2009 Author Posted November 17, 2009 so there's no IE functions at all that can click the browse button on that site & then select a file..?? what would be the best way/functions to do it then..??
jvanegmond Posted November 17, 2009 Posted November 17, 2009 Use mouse clicks and keyboard input. IE8 now blocks attempts to fill in a file input, because it's a security risk. github.com/jvanegmond
cypher175 Posted November 17, 2009 Author Posted November 17, 2009 whats the best way to click the browse button to select a file for upload..?? $UpFile = _IEGetObjByName($IE, "upfile") _IEAction($UpFile, "click") or by forcing a mouse click on that location or something that works better..??
jvanegmond Posted November 17, 2009 Posted November 17, 2009 See the last two examples in _IEFormElementSetValue . github.com/jvanegmond
cypher175 Posted November 17, 2009 Author Posted November 17, 2009 i thought you said you couldn't use these function because IE8 security restrictions prevent using _IEFormElementSetValue..??
jvanegmond Posted November 17, 2009 Posted November 17, 2009 If you would have gone and read the example like I told you to, you would have found out that these examples provide work arounds for what you can't do with _IEFormElementSetValue. github.com/jvanegmond
cypher175 Posted November 17, 2009 Author Posted November 17, 2009 i have read it before & also tried to make it work for my project too - but it never seemed to work right.. have you tried it - did it work for you on IE8..??
jvanegmond Posted November 17, 2009 Posted November 17, 2009 No, the examples don't work out of the box with IE8. They don't allow you to type in the box anymore, but like I've told you two times already: Use mouse and keyboard. There may be some custom work involved... github.com/jvanegmond
jvanegmond Posted November 17, 2009 Posted November 17, 2009 There are examples in the help file under _IEFormElementSetValue. Particularly the last two examples. github.com/jvanegmond
DaleHohm Posted November 17, 2009 Posted November 17, 2009 OK, here is an example: #include <IE.au3> $oIE = _IE_Example("form") $oT = _IEGetObjById($oIE, 'fileExample') MouseMove(_IEPropertyGet($oT, "screenx") + _IEPropertyGet($oT, "width") - 10, _ _IEPropertyGet($oT, "screeny") + _IEPropertyGet($oT, "height")/2) MouseClick("left") WinWait("Choose File to Upload") $hChoose = WinGetHandle("Choose File to Upload") ControlSetText($hChoose, "", "Edit1", "C:\AUTOEXEC.BAT") ControlClick($hChoose, "", "Button2") 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
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