Getting URL information from Explorer using JavaScript
Getting URL information from Explorer using JavaScript
- Subject: Getting URL information from Explorer using JavaScript
- From: macgix <email@hidden>
- Date: Wed, 3 Oct 2001 22:39:18 +0200
Another way to do this with IE (4.5 or 5.x) is:
-- ------
tell application "Internet Explorer"
set the_url to do script "javascript:window.location;"
end tell
-- "the_url" contains the current frontmost URL as string
-- ------
Don't know, if this is the correct syntax because i am sitting in front of
my PB190 running 7.6.1 and cannot look up my sources in the company by now
and it's right late in the eve here. ;)
But this is the way my "Picture Grabber" catches the URL from Explorer.
Kind Regards,
Thomas
>
From: Daniel Blanken <email@hidden>
>
>
For IE try this:
>
>
=============
>
tell application "Internet Explorer"
>
--get information for frontmost window (i.e. the window with index -1)
>
set the_info to (GetWindowInfo -1)
>
--the result is a list in format {[URL of the window],[Title of the
>
window]}
>
set the_URL to (item 1 of the_info) as string
>
end tell
>
--return the URL of frontmost window as string
>
return the_URL
>
==============
>
>
The current version of Netscape isn't installed on my machine, so I cannot
>
give you a solution here, sorry.
>
>
Greetings!
>
Daniel Blanken
>
---------------------------------------
macgix Thomas Johannes Matthias K|hner
Developer, Supervisor, Manager
email@hidden
www.macgix.com / www.macgix.de