选择 Windows 自动化脚本语言。AutoIt 与 Autohotkey

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1686975/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 06:53:14  来源:igfitidea点击:

Choosing a Windows automation scripting language. AutoIt vs Autohotkey

windowsscriptingautomationautohotkeyautoit

提问by PA.

I need to choose a Windows automation scripting language. Which one do you recommend; AutoIt, AutoHotkey, or an other?

我需要选择一种 Windows 自动化脚本语言。你推荐哪一个;AutoItAutoHotkey,还是其他?

I have read "An AutoIt / AutoHotkey comparison". Interesting history, but without recommendation. Searching Google leaves around 312k hits for AutoHotkey Windowsvs 482k for AutoIt Windows. On Stack Overflow there are 15 questions tagged autoitvs 18 autohotkey.

我读过“一个 AutoIt / AutoHotkey 比较”。有趣的历史,但没有推荐。在谷歌搜索中,搜索结果为AutoHotkey Windows312k,而AutoIt Windows. 在 Stack Overflow 上,有 15 个问题标记为autoit与 18 autohotkey

I am interested in your opinion as programmers. Which one do you think is easier to use, more deployable and more powerful in terms of functionality? I have already used AutoHotkey for personal use, so my initial preference is for this.

作为程序员,我对您的意见很感兴趣。您认为哪个更易于使用、更易于部署且功能更强大?我已经将 AutoHotkey 用于个人用途,所以我最初的偏好是这个。

采纳答案by Zenjin

I've used both very much.

我两个都用过很多。

AutoHotKey is very good at managing hotkeys and basic GUI automation. It's syntax is horrible and it's not meant for bigger applications.

AutoHotKey 非常擅长管理热键和基本的 GUI 自动化。它的语法很糟糕,并不适用于更大的应用程序。

AutoIt has almost every feature AutoHotKey has and much more. COM-automation support, arrays and a pretty nice UDF (User Defined Functions) library. It's harder to build complex hotkeys in AutoIt.

AutoIt 几乎拥有 AutoHotKey 的所有功能以及更多功能。COM 自动化支持、数组和非常好的 UDF(用户定义函数)库。在 AutoIt 中构建复杂的热键更加困难。

回答by Zenjin

  • I think AutoHotkey's GUI implementation is easier to use like many of its commands.
  • AutoHotkey (no longer maintained) has 3 forks :
    • AutoHotkey v1.1.* (previously known as AutoHotkey_L) has COM, Unicode support, object-oriented -like syntax, arrays, and more.
    • AutoHotkeyCE works on Windows mobile PDA's and smartphones (unfinished, no longer maintained).
    • IronAHK, a .NET version of AutoHotkey (unfinished, no longer maintained).
  • AutoHotkey includes a DLL file that you can call from other programming languages (so does AutoIt).
  • AutoHotkey is open source, AutoIt is not.
  • You have to search the AutoHotkey site to put all tools together. AutoIt does better at packaging all in its initial download.
  • 我认为 AutoHotkey 的 GUI 实现就像它的许多命令一样更容易使用。
  • AutoHotkey(不再维护)有 3 个分叉:
    • AutoHotkey v1.1.*(以前称为 AutoHotkey_L)具有 COM、Unicode 支持、面向对象的语法、数组等。
    • AutoHotkeyCE 适用于 Windows 移动 PDA 和智能手机(未完成,不再维护)。
    • IronAHK,AutoHotkey 的 .NET 版本(未完成,不再维护)。
  • AutoHotkey 包含一个可以从其他编程语言调用的 DLL 文件(AutoIt 也是如此)。
  • AutoHotkey 是开源的,AutoIt 不是。
  • 您必须搜索 AutoHotkey 站点才能将所有工具放在一起。AutoIt 在初始下载时打包所有内容做得更好。

My vote is for AutoHotkey (AHK).

我的票是 AutoHotkey (AHK)。

回答by Norris Green

AutoIt is a tremendous tool and its seductive ease of use and immense library of UDFs, coupled with an unbeatable help file, is hard to compare to.

AutoIt 是一个了不起的工具,其诱人的易用性和庞大的 UDF 库,再加上无与伦比的帮助文件,很难与之相比。

I tried AutoHotkey, but its clunky feel and shabby syntax turned me off. Why settle for the ugly sister when you can wine and dine the princess herself. AutoIt 100%.

我尝试过 AutoHotkey,但它笨拙的感觉和破旧的语法让我失望。既然公主自己可以喝酒吃饭,为什么还要为丑陋的妹妹安顿下来呢?自动 100%。

回答by NateH

I use both depending on the situation. AutoHotkey is nice for quick keystroke macros and AutoIt has a much broader range of automation functionality and user-defined functions (UDFs) allow a range of useful things such as XML and database interaction. When automation requires a lot of GUI interaction I use AutoIt.

我根据情况使用两者。AutoHotkey 非常适合快速击键宏,而 AutoIt 具有更广泛的自动化功能和用户定义函数 (UDF),允许进行一系列有用的事情,例如 XML 和数据库交互。当自动化需要大量 GUI 交互时,我使用 AutoIt。

回答by PhiLho

I used AutoIt before AutoHotkey was created (when it had a syntax inherited from BAT files). I don't have enough experience with current AutoIt to make a correct comparison. It has a quite regular syntax, while AutoHotkey's syntax (although greatly improved from the original style) seems odd. People having never coded before actually love this syntax!

我在创建 AutoHotkey 之前使用了 AutoIt(当它具有从 BAT 文件继承的语法时)。我对当前的 AutoIt 没有足够的经验来进行正确的比较。它有一个非常规则的语法,而 AutoHotkey 的语法(虽然比原来的风格有了很大的改进)看起来很奇怪。以前从未编码过的人实际上喜欢这种语法!

I hesitated, read numerous comparisons, and finally chose AutoHotkey despite its syntax. Partly because of its superior hotkey management, partly because it was open source. The author was active (he stopped, but there are alternative branches now) and open to suggestions. I shown a prototype of regular expression support using a PCREDLL. He integrated the concepts and pushed them beyond (regular expression support in window name detection for example).

我犹豫了一下,看了无数对比,最后还是选择了 AutoHotkey,尽管它有语法。部分是因为它卓越的热键管理,部分是因为它是开源的。作者很活跃(他停止了,但现在有其他分支)并且愿意接受建议。我展示了一个使用PCREDLL的正则表达式支持原型。他整合了这些概念并将它们推向了更高的范围(例如,窗口名称检测中的正则表达式支持)。

Documentation is excellent, detailed and full of examples with a comprehensive index. The community is very active and helpful. The binary is compact and you can make a standalone EXE file with your scripts. It also has GUI support (good for quick simple dialog windows).

文档非常好,详细且充满示例,并带有全面的索引。社区非常活跃和乐于助人。二进制文件很紧凑,您可以使用脚本制作独立的 EXE 文件。它还具有 GUI 支持(适用于快速简单的对话框窗口)。

I won't say one is better, the choice is mostly a matter of taste, feeling and needs.

我不会说一个更好,选择主要是品味、感觉和需求的问题。

回答by user233612

I worked with AutoHotkey and thought the language was difficult. I suppose it is either an acquired taste or some people have affinity for it. I was a long-time Perfect Keyboard user but am now a huge fan of AutoIt.

我和 AutoHotkey 一起工作,觉得这门语言很难。我想它要么是一种后天的品味,要么是某些人对它有亲和力。我是 Perfect Keyboard 的长期用户,但现在是 AutoIt 的忠实粉丝。

Though it is Basic-like I can still write "C" -like programs which is most comfortable for me. And the libraries for AutoIt, what a time saver. For example, the library for IE has a lot of great and useful functions. Good IDE and active user community.

虽然它是类似 Basic 的,但我仍然可以编写对我来说最舒服的类似“C”的程序。还有 AutoIt 的库,真是太省时了。例如,IE 的库有很多很棒的和有用的功能。良好的 IDE 和活跃的用户社区。

My vote is with AutoIt.

我的投票是 AutoIt。

回答by Sam Russo

I have been extremely happy with AutoIt. The language is an easy flavor of Basic. They include great help files, a script compiler, an editor that understands not only the syntax but supports F1for help, etc. They have plenty of code samples.

我对 AutoIt 非常满意。该语言是 Basic 的一种简单风格。它们包括很好的帮助文件、脚本编译器、不仅理解语法而且支持F1帮助的编辑器等。它们有大量的代码示例。

I don't have any first hand experience with AutoHotKey - I do remember considering it, but I've never looked back since using AutoIt.

我对 AutoHotKey 没有任何第一手经验——我确实记得考虑过它,但自从使用 AutoIt 以来我从未回头。