首页 > 解决方案 > 无法运行基本示例 autoit 脚本

问题描述

我用 AutoIt 编译了下面的脚本并创建了 .exe 文件。但是,当我运行它时它不会启动(只需在右下屏幕闪烁一秒钟然后消失)。知道为什么吗?

脚本示例复制自:AutoIt General Help and Support Forum

#include <IE.au3>

Opt("MouseCoordMode", 2)
Opt("WinTitleMatchMode", 4)

$hWnd = WinGetHandle("AutoIt Script Home Page - Windows Internet Explorer")

;WinWait($hWnd)
;If Not WinActive($hWnd) Then WinActivate($hWnd)
;WinWaitActive($hWnd)

; WINDOW IS NOT ACTIVE!!

sleep(1000)
ControlClick($hWnd, "", "Internet Explorer_Server1", "left", 1, 722, 125) ;;;;Opens The forum

; Does not Work when NOT active!!

;even statusbar only works when active

$status=StatusbarGetText($hWnd)
ConsoleWrite($status&@LF)

标签: autoit

解决方案


推荐阅读