John117 Posted August 8, 2007 Posted August 8, 2007 I have seen scripts to create a new IE Page in a new browser. (Creates body and all in code) I have seen scripts to change the url of the current browser. (Does not create body) Can anyone show me any example of changing the current browser to a new IE Page. (A page with a body written in code/not a url)
DaleHohm Posted August 8, 2007 Posted August 8, 2007 #include <IE.au3> $oIE = _IECreate() $sPage = "<HTML><HEAD></HEAD><BODY>Page 1</BODY></HTML>" _IEDocWriteHTML($oIE, $sPage) $sPage = "<HTML><HEAD></HEAD><BODY>Page 2</BODY></HTML>" _IEDocWriteHTML($oIE, $sPage) 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
John117 Posted August 8, 2007 Author Posted August 8, 2007 DaleHohm -Thanks for the reply Im sorry to say I wasn't clear enough with my request. suppose I open IE and naviate to a url (any url) I then run your code to create my page. I would like the result to be that the already opened IE just changes to mine. (not a second browser popup) Can this be done?
DaleHohm Posted August 8, 2007 Posted August 8, 2007 Sounds rather shady... please don't make me part of something nefarious... #include <IE.au3> $oIE = _IECreate("http://www.google.com") $sPage = "<HTML><HEAD></HEAD><BODY>Page 1</BODY></HTML>" _IEDocWriteHTML($oIE, $sPage) $sPage = "<HTML><HEAD></HEAD><BODY>Page 2</BODY></HTML>" _IEDocWriteHTML($oIE, $sPage) 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
John117 Posted August 9, 2007 Author Posted August 9, 2007 Nefarious and shady? na, here's the post to give you a little insite.http://www.autoitscript.com/forum/index.ph...st&p=385639 I was hoping to do the following without it opening a new window, since the user will already have the browser open when typing www.yahoo.comI tried what you posted shortly after my last reply. It still opened a new window. I also tried to set it up as _IENavigate but since I never opened the first browser, $oIE was not declared so it had no reference. Could I use something to find the active IE? With www.yahoo.com in the addressbar?(!) Thanks - Code belowCODE#include <GuiConstants.au3>#include <file.au3>#include <IE.au3>Dim $aRecords, $bRecords, $cRecordsIf Not _FileReadToArray(@ScriptDir & "\A.txt", $aRecords) Then MsgBox(4096, "Error", " Error reading A.txt log to Array error:" & @error) ExitEndIfIf Not _FileReadToArray(@ScriptDir & "\B.txt", $bRecords) Then MsgBox(4096, "Error", " Error reading B.txt log to Array error:" & @error) ExitEndIfIf Not _FileReadToArray(@ScriptDir & "\C.txt", $cRecords) Then MsgBox(4096, "Error", " Error reading C.txt log to Array error:" & @error) ExitEndIf$oIE = _IECreate()$MyMessage = $aRecords[Random(1, UBound($aRecords) - 1, 1) ] & $bRecords[Random(1, UBound($bRecords) - 1, 1) ] & $cRecords[Random(1, UBound($cRecords) - 1, 1) ]$sPage = "<HTML><HEAD></HEAD><BODY>" & $MyMessage & "</BODY></HTML>"_IEDocWriteHTML($oIE, $sPage)sleep (4000)_IENavigate($oIE, "http:\\www.yahoo.com")BTW-Nefarious gets me fired (!) funny gets overlooked / This will not work with out building the txt files listed in the link
DaleHohm Posted August 9, 2007 Posted August 9, 2007 So, if "existing" browser is what you want... see _IEAttach -- lots of options on how to use it. 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
John117 Posted August 9, 2007 Author Posted August 9, 2007 Will study up tomorrow evening from the help file thanks!
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