internet-explorer - 如何使用 AutoIT 处理 IE 下载通知栏
问题描述
我想使用 Autoit 从下载通知栏中选择另存为选项,但无法专注于通知栏。如果我手动选择另存为按钮,则 Autoit 脚本的其余部分将起作用。
代码:
WinWait("[Actimize] Item Details - Internet Explorer")
;Option 1: focus on notification bar
ControlFocus("[Actimize] Item Details - Internet Explorer","","DirectUIHWND1")
; or
;Option 2: Send alt+n key to focus on navigation bar
Send("!n")
;Send DOWN key to navigate to Save as option
Send("{DOWN}")
;Send A to open the 'Save as' dialog box
Send("{a}")
;Wait for dialog window to open
WinWait("Save As")
$hWnd = WinGetHandle("Save As")
Sleep(2000)
;Set focus on 'Save as' dialog box
ControlFocus($hWnd, "", "[CLASS:Edit; INSTANCE:1]")
;Set text to TEST_FILE.html
ControlSetText($hWnd, "", "[CLASS:Edit; INSTANCE:1]", "Test_File", 1)
;Sleep for 4s
Sleep(4000)
ControlFocus($hWnd, "", "[CLASS:ToolbarWindow32; INSTANCE:3]")
; Right-click inside control to invoke "Edit Address"
ControlClick($hWnd, "", "[CLASS:ToolbarWindow32; INSTANCE:3]", "right")
; Choose the "Edit Address" option
ControlSend($hWnd, "", "[CLASS:ToolbarWindow32; INSTANCE:3]", "e")
Sleep(250)
Send("{DEL}")
Sleep(250)
Send("autoIt\au3_files\IE" & "{ENTER}")
Sleep(250)
ControlClick($hWnd, "", "[CLASS:Button; TEXT:&Save;]")
WinClose($hWnd)
解决方案
推荐阅读
- c++ - 将右值引用转换为临时参数的正确方法在 C++ 中返回 const 左值
- terraform - 多个保险库身份验证后端上的数据查找索引无效
- powerbi - 使用 PowerQuery 在几个月内按比例计算结果
- set - 在打印集时获得更少的元素
- java - 找不到匹配的构造函数:java.time.ZonedDateTime()
- excel - Excel中的嵌套vlookup?- 获取数组中的特定数字
- python - 如何在时间序列中使用 mean() 并将其放到列中?
- r - R中的子集代码之间存在不同的结果
- javascript - Javascript数组过滤和提取
- azure - 使用变量组和模板的 Azure Pipelines 变量的意外行为