Re: Getting Internet Explorer 5.2 window name
Re: Getting Internet Explorer 5.2 window name
- Subject: Re: Getting Internet Explorer 5.2 window name
- From: julifos <email@hidden>
- Date: Sun, 15 Dec 2002 13:12:29 +0000
>
Internet Explorer's applescript implementation is terribly deficient.
>
Although the "GetWindowInfo" works for the name, it is non-standard,
>
and apart from the URL, that's all you can get.
I agree about its deficient AS object model, but I think the best ever known
implementation as a bridge between AS & Javascript-jscript is just here, at
IE. Tx to this "do script" command you can retrieve any object owned by the
document, and I think this is cool! You can get-set value of multiple
properties, such as *window name*:
do script "document.title='new title is equal to new window name'"
You can fill forms, check radio buttons, get a list of images/urls in the
document, change text properties, navigate via script editor, open-close
windows, override defined functions (such as "function popupwindow()")...
>
I use iCab (www.icab.de) as my main browser, and it has a pretty good
>
implementation.
Icab is one of the very best browsers I've ever known (though its uncomplete
CSS implementation), but I'd say its dictionary is a copy of both IE &
mozilla-browsers suites (look, too, Opera's dictionary)
>
For example:
>
>
tell application "iCab"
>
name of window 1
>
end tell
>
>
works for me just fine (plus many other properties of the window, for
>
example I have QuicKeys/AppleScripts that make the window a certain
>
size, move it to a particular location etc.).
As I said, you can manipulate this and even much more in IE:
tell app "IE"
set win_name to do script "document.title"
set win_name_2 to (GetWindowInfo -1)'s item 2
-- both statements return the same string
do script "self.moveTo(100,150);self.resizeTo(600,400)"
-- this will move/resize the window
do script "midW=(screen.availWidth)/2;
midH=(screen.availHeight)/2;
self.resizeTo(600,400);
self.moveTo(midW-300,midH-200);"
-- and this will resize & center the window on screen
end tell
And, with a little of imagination, you can also bookmark the current page or
add an item to the download manager...
Of course, you can use javascript too, in iCab, too, but it's a little
tricky and it won't return results to applescript... eg:
tell application "iCab"
OpenURL "javascript:void(document.images[0].width=12)"
-- this will resize first image's width to 12 pixels :-)
OpenURL "javascript:void(document.images[1].width)"
-- but this won't return current width of the second one :-(
end tell
>
I believe that other non-Microsoft browsers also have good
>
AppleScript implementations.
Sure! ;-)
JJ
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.