plat Posted August 17, 2006 Share Posted August 17, 2006 Hi; I am having trouble with IE.au3 syntax; The following code will navigate to an url already in the clipboard but what I am trying to achieve is to capture the current URL to a variable- say by right clicking a systray context menu from the application I am writing. The end aim is to be able to download the current page using InetGet for offline string parsing without having to hightlight the text in the URL bar first as the example below would require. Any thoughts greatly appreciated... #include <IE.au3> $sURL = ClipGet() $oIE = _IECreate ($sURL) $addr = _IEPropertyGet ($oIE, "LocationURL") Msgbox(0, "", $addr) Link to comment Share on other sites More sharing options...
DaleHohm Posted August 17, 2006 Share Posted August 17, 2006 Your syntax looks fine. I ran your code and ended up with the current URL in $addr What happens for you? Do I misunderstand your question? 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...
plat Posted August 17, 2006 Author Share Posted August 17, 2006 Your syntax looks fine. I ran your code and ended up with the current URL in $addrWhat happens for you? Do I misunderstand your question?DaleHi Dale; The bit I am having trouble with is how to get $addr assigned on the fly; Surf the net and at I time I choose hit a key and the script grabs the current url for me (i.e. no need to manually select contents of address bar & ctrl+c to populate the clipboard) Link to comment Share on other sites More sharing options...
DaleHohm Posted August 17, 2006 Share Posted August 17, 2006 how to get $addr assigned on the fly; Surf the net and at I time I choose hit a key and the script grabs the current url for meI'm sorry, I need to to be more explicit about what you are trying to do. This is way too ambiguous.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...
lod3n Posted August 17, 2006 Share Posted August 17, 2006 (edited) expandcollapse popup#include <IE.au3> Opt("GUIOnEventMode", 1) global $title = "IE Monitor" ; the following sets CTRL-F12 as your on the fly url grabbing hotkey, ; but change this to what you want if not HotKeySet ( "^{f12}" , "graburl" ) then msgbox(0,$title,"Error, could not set graburl hotkey") Exit EndIf if not HotKeySet ( "{esc}" , "abort" ) then msgbox(0,$title,"Error, could not set abort hotkey") Exit EndIf $sURL = ClipGet() if stringinstr($sURL,"http://") Then global $oIE = _IECreate ($sURL) Else global $oIE = _IECreate () EndIf while 1 sleep(1000) WEnd func graburl() $addr = _IEPropertyGet ($oIE, "LocationURL") clipput($addr) Msgbox(0, $title, $addr) EndFunc func abort() Msgbox(0, $title, "Esc pressed, aborting") Exit EndFunc Edited August 17, 2006 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
AceLoc Posted August 17, 2006 Share Posted August 17, 2006 also check out IE builder v2 [quote name='AceLoc']I gots new sunglasses there cool.[/quote] Link to comment Share on other sites More sharing options...
plat Posted August 18, 2006 Author Share Posted August 18, 2006 Turns out the following code achieves what I need Thanks eveyone for your input... $oIE = _IEAttach ("bbc") $ItemAddress = _IEPropertyGet ($oIE, "locationurl") 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