![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How to click on arbitrary highlighted item Our company recently upgraded to IE7, and at the same time locked down our IE system settings with group policies, so that we can't click on Tools -> Internet Options and change anything. Unfortunately, the upgrade broke the script I was using to access a remote site and download a file automatically. Now, when I try to start the download, I get the message, "To help protect your security, Internet Explorer blocked this site from downloading files to your computer. Click here for options..." Since I can't change the IE settings, I decided to kludge my script to click on the warning and tell it to go ahead with the download. However, I can't figure out what to tell my script to click on. Since the warning is generated by IE rather than the webpage, I don't know what to use the Click method on. I did manage to use SendKeys to send enough Tab characters to highlight the warning, but how do I use the Click method to click on it once it's highlighted? Thanks in advance to all who respond. Leslie |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to click on arbitrary highlighted item On Jan 16, 12:34*pm, Leslie Houk <lh...@xxxxxx> wrote: Quote: > Our company recently upgraded to IE7, and at the same time locked down > our IE system settings with group policies, so that we can't click on > Tools -> Internet Options and change anything. *Unfortunately, the > upgrade broke the script I was using to access a remote site and > download a file automatically. *Now, when I try to start the download, > I get the message, "To help protect your security, Internet Explorer > blocked this site from downloading files to your computer. *Click here > for options..." > > Since I can't change the IE settings, I decided to kludge my script to > click on the warning and tell it to go ahead with the download. > However, I can't figure out what to tell my script to click on. *Since > the warning is generated by IE rather than the webpage, I don't know > what to use the Click method on. *I did manage to use SendKeys to send > enough Tab characters to highlight the warning, but how do I use the > Click method to click on it once it's highlighted? > > Thanks in advance to all who respond. > Leslie 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 ========== |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How to click on arbitrary highlighted item 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...@xxxxxx> wrote: Quote: > > 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 > ========== |
My System Specs![]() |
| | #4 (permalink) |
| | Re: How to click on arbitrary highlighted item Tom Lavedas schrieb: Quote: > On Jan 16, 12:34 pm, Leslie Houk <lh...@xxxxxx> wrote: Quote: >> Our company recently upgraded to IE7, and at the same time locked down >> our IE system settings with group policies, so that we can't click on >> Tools -> Internet Options and change anything. Unfortunately, the >> upgrade broke the script I was using to access a remote site and >> download a file automatically. Now, when I try to start the download, >> I get the message, "To help protect your security, Internet Explorer >> blocked this site from downloading files to your computer. Click here >> for options..." Quote: > 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 Quote: > oXML.send > With CreateObject("ADODB.Stream") > .type = adTypeBinary > .mode = adModeReadWrite > .open > Do Until oXML.readyState = 4 : Wscript.Sleep 50 : loop Quote: > .write oXML.responseBody > .savetofile FilePath, adSaveCreateOverwrite > End With > End Sub |
My System Specs![]() |
| | #5 (permalink) |
| | Re: How to click on arbitrary highlighted item On Jan 16, 6:19*pm, Leslie Houk <lh...@xxxxxx> wrote: Quote: > 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 > that instruments mouse clicks as well as sending keys and other things. Tom Lavedas ========= |
My System Specs![]() |
| | #6 (permalink) |
| | Re: How to click on arbitrary highlighted item "Leslie Houk" <lhouk@xxxxxx> wrote in message news:4a0b5e82-c973-45b8-8841-af1ff7531de6@xxxxxx 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...@xxxxxx> wrote: Quote: > > 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 > ========== 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 |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Right Click New Item | Vista General | |||
| Arbitrary changes | Vista General | |||
| Right-click item in Start Menu = Explorer crash | Vista General | |||
| Custom Right Click Menu Item | Vista General | |||
| Right-click item on start menu = explorer crash | Vista General | |||