jlorenz1 Posted January 21, 2007 Share Posted January 21, 2007 Hallo, I have written a script to upload pictures to Wikipedia. It is for people like me, which use an analog internet connection. The advantage of this script is, that you can prepare all necessary information of a picure offline. My problem is that _IEFormSubmit($oForm, 1)oÝ÷ ÚÇËhmëh¢«¢rBjwâZ.¶Ø^~æjwHq©ìzwb´Óë-jÛ¬mªò¢ëz0¶©®+zËj¸+£Ø+£ºØî²Ö÷KazÇ+ly鬶ÞæËØ^ºhiÖ§vËZ®Ø§Ø^ºhiÚ¶§{iËnæî¶'Ƚêâ(u¢'©yØ"Ƕ¶®¦Zw¬m²çz˺R7ö÷覦·¬²*'¶¶®¦Zv)঺y׫yÊÚ²hÂv÷F§wjw«®æzËæÇ£¯¢'m+?lÈßÙ®¦Zv)àj¶êÞ©îjYr#ek¥¨Â+a+©yÚbrÛ«z'íë©x)®uêÞÁ«,¹Ç²ÇîØmë®*m"Ç¢yr¶ ®" k¢ Þ²ÆÚ®)íë-jÛ¬mªÛºÙè¶Ø^Áæéj+,jey§-ð¢¹,jëh×6#include <IE.au3> $oIEFW = _IECreate('http://www.google.de') $oFormFW = _IEFormGetObjByName($oIEFW, 'f') $oQueryFW = _IEFormElementGetObjByName($oFormFW, 'q') _IEFormElementSetValue($oQueryFW, 'wikfeder download') _IEFormSubmit($oFormFW, 1)oÝ÷ Ù8b±ú+ºhiا¶êÞ±Ú²}ý· +)àjëh×6#include <IE.au3> $oIE = _IECreate('http://de.wikipedia.org/wiki/Spezial:Hochladen') $oForm = _IEFormGetObjByName($oIE, 'Upload') $oInputFile = _IEFormElementGetObjByName($oForm, "wpUploadFile") _IEAction($oInputFile, "focus") $oQuery1 = _IEFormElementGetObjByName($oForm, 'wpDestFile') _IEFormElementSetValue($oQuery1, IniRead(@ScriptDir & '\wikifill.ini', $i, 'Dateiname', 'Fehler')) $oQuery3 = _IEFormElementGetObjByName($oForm, 'wpUploadDescription') _IEFormElementSetValue($oQuery3, $sDesc) $oSelect = _IEFormElementGetObjByName($oForm, 'wpLicense') _IEFormElementOptionselect($oSelect, IniRead(@ScriptDir & '\wikifill.ini', $i, 'GenehmigungII', 'Fehler'), 1, 'byText') If IniRead(@ScriptDir & '\wikifill.ini', $i, 'Seite beobachten', 'Fehler') = 4 Then $Watch = 0 Else $Watch = 1 EndIf _IEFormElementCheckBoxSelect($oForm, 'wpWatchthis', '', $Watch, 'byIndex') _IEFormSubmit($oForm, 1) Thanks Johannes Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post] Link to comment Share on other sites More sharing options...
DaleHohm Posted January 22, 2007 Share Posted January 22, 2007 "crashes" is not a very precise word (particularly the way you are using it) -- more debugging needs to be done to see what is really happening. I suggest you start with changing your _IEFormSubmit($oForm, 1) to _IEFormSubmit($oForm, 0) followed by _IELoadWait($oIE) -- if you still have trouble you'll need a better understanding of how _IELoadWait works. I'll explain both of these things in more detail when you share the results from the suggested change. 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 Link to comment Share on other sites More sharing options...
jlorenz1 Posted January 22, 2007 Author Share Posted January 22, 2007 (edited) "crashes" is not a very precise word (particularly the way you are using it) -- more debugging needs to be done to see what is really happening.I suggest you start with changing your _IEFormSubmit($oForm, 1) to _IEFormSubmit($oForm, 0) followed by _IELoadWait($oIE) -- if you still have trouble you'll need a better understanding of how _IELoadWait works. I'll explain both of these things in more detail when you share the results from the suggested change.DaleHello Dale,sorry for my bad english & thanks for your patience. My last trial was to upload only one picture with your new code with no success. I capture three windows of the process. The first one is uploading the picture by script. The second window is the result of uploading one picture by script. The third one shows the result of a successfully uploaded picture (it was done manually - i was using the second window, choose only the file and submit manually). This is a better explaining than words.In SCITE there's no error message. PC is Athlon 3,2 GHz 516 MB RAM Analoginternet, Windows2000, IE6SP1 Ask me again, if you don't understand something. Thanks Johannes P.S. Next last trial: If I use Send('{ENTER}') instead of _IEFormSubmit($oForm, 0) IT WORKS. Strange, but I would prefer _IESubmit you don't need to lock the keyboard and the window must not be active. (In my trials I was doing nothing than executing my script and IE) Edited January 22, 2007 by jlorenz1 Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post] Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted January 22, 2007 Moderators Share Posted January 22, 2007 Try getting a reference to the Submit Button and use _IEAction($o_object, "click") on it. Link to comment Share on other sites More sharing options...
jlorenz1 Posted January 22, 2007 Author Share Posted January 22, 2007 Try getting a reference to the Submit Button and use _IEAction($o_object, "click") on it.Hi Big Daddy,thanks. I must declare: I'm really a newbie in _IEForms. I will try it and I'm sure, if that command exists - it will be the solution.Johannes Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post] Link to comment Share on other sites More sharing options...
DaleHohm Posted January 22, 2007 Share Posted January 22, 2007 There is an example of doing exactly this in the helpfile for _IEAction 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 Link to comment Share on other sites More sharing options...
jlorenz1 Posted January 23, 2007 Author Share Posted January 23, 2007 Hi DaleHohm & big_daddy, it works excellent. Thanks! Thanks!Thanks!Thanks!Thanks!Thanks!Thanks!Thanks!Thanks!Thanks!.... Johannes Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post] Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted January 23, 2007 Moderators Share Posted January 23, 2007 No problem, glad we were able to help! Link to comment Share on other sites More sharing options...
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