Re: How to click on arbitrary highlighted item
- From: "Paul Randall" <paulr90@xxxxxxx>
- Date: Sun, 18 Jan 2009 09:31:50 -0700
"Leslie Houk" <lhouk@xxxxxxx> wrote in message
news:4a0b5e82-c973-45b8-8841-af1ff7531de6@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Tom,
Thanks for the response. I did try sending the Enter key, but it
doesn't seem to have any effect. Sending the Esc key will close the
warning, so I'm guessing that it only responds to the Escape key and
to being clicked on, which opens a drop-down menu of actions.
The code to download the file is a good idea as well, but I didn't
mention that the website I'm hitting is the front end for a database.
I get the file I want to download by clicking on an Export button,
which generates the file on the fly. So, an actual file which I could
download doesn't exist.
But again, thanks for the ideas, and please let me know if you have
any others.
Leslie
On Jan 16, 2:27 pm, Tom Lavedas <tglba...@xxxxxxx> wrote:
You could just send an Enter key, something like ...
oWSHShell.Sendkeys "{Enter}"
However, why don't you just download the file directly using something
like ...
Sub DownBinFile(FilePath, sURL)
const adTypeBinary = 1
const adModeReadWrite = 3
const adSaveCreateOverwrite = 2
' Create an xmlhttp object:
set oXML = CreateObject("MSXML2.XMLHTTP")
oXML.open "GET", sURL, False
oXML.send
With CreateObject("ADODB.Stream")
.type = adTypeBinary
.mode = adModeReadWrite
.open
Do Until oXML.readyState = 4 : Wscript.Sleep 50 : loop
.write oXML.responseBody
.savetofile FilePath, adSaveCreateOverwrite
End With
End Sub
Tom Lavedas
==========
I think that Tom's idea of using AutoItX is the way to go. AutoIt includes
a utility to identify each of the active areas on an open window, like your
popup. You script can do the things that activate the popup, tell AutoItX
to wait for the popup, and click the active spot of interest on the popup.
I've found AutoItX to be a resourse hog, so you might not want it waiting
24x7 for some window to pop up, but in you situation it would only be
waiting for the window for a short time.
http://www.autoitscript.com/autoit3/downloads.shtml
-Paul Randall
.
- References:
- How to click on arbitrary highlighted item
- From: Leslie Houk
- Re: How to click on arbitrary highlighted item
- From: Tom Lavedas
- Re: How to click on arbitrary highlighted item
- From: Leslie Houk
- How to click on arbitrary highlighted item
- Prev by Date: Re: Recherche news groupe FR pour problème VBS / Search news group FR problem VBS
- Next by Date: Re: How do I create a mask for a phone #?
- Previous by thread: Re: How to click on arbitrary highlighted item
- Next by thread: Re: How to click on arbitrary highlighted item
- Index(es):