I couldn't find hard proof, as the AU3's beta changelog doesn't include dates, but I'm pretty sure AU3 (AutoIt3) is older than AHK (AutoHotkey). I'll try to give a compare and contrast here, but you should know that I've never actually coded in AU3.
Well, AU3 and AHK are both based on AU2 (AutoIt2). However, it's interesting to note that while AHK provides backwards compatibility with AU2 (to an extent), AU3 does not. This is probably due to the first and most obvious difference between AU3 and AHK: syntax. Here is an example of a script written in AU3:
Code:
; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language: English
; Platform: Win9x / NT
; Author: Scriptkitty
;
; Script Function:
; This is based on the thought that your mind will rearange words
; as long as the first and last letters are right, and all of the letters
; are in the word. Example, wrod if read fast would appear to be word as your mind
; will base it on context. Just for fun. Copy a bunch of text into the clipboard and run it.
;
; To deal with various puntuations I did a cheep mickeymouse fix for now.
; ----------------------------------------------------------------------------
$clip=clipget()
;$clip="Hello there fine folks"
cheepfix1()
$words=StringSplit($clip," ")
$mixed=""
for $i=1 to $words[0]
$jumble=jumble($words[$i])
if $jumble=$words[$i] and stringlen($words[$i])>3 then
$i=$i-1
ContinueLoop; this makes sure everything is mixed up.
EndIf
$mixed=$mixed & " " & $jumble
Next
cheepfix2()
msgbox(1,"Mixed up version",$mixed)
msgbox(1,"Normal version",$clip)
func cheepfix1()
$x=stringsplit(",'?!.></\@#$%&*()`{}[]","")
for $i=1 to $x[0]
$clip=StringReplace($clip,$x[$i]," "& $x[$i])
Next
$clip=StringReplace($clip,@cr," "& @cr)
$clip=StringReplace($clip,@lf,@lf & " ")
EndFunc
func cheepfix2()
$x=stringsplit(",'?!.></\@#$%&*()`{}[]","")
for $i=1 to $x[0]
$jumble=StringReplace($jumble," " & $x[$i],$x[$i])
Next
$jumble=StringReplace($jumble," "& @cr,@cr)
EndFunc
func jumble($_word)
if stringlen($_word)<3 then return $_word
$_letters=Stringsplit($_word,"")
$_jumble=$_letters[1]
$_used=" |"
$_count=2
while $_count<$_letters[0]
tooltip($_jumble,0,0)
$ran=int(random(2,$_letters[0]))
if stringinstr($_used,"|" & $ran & "|")=0 then
$_count=$_count+1
$_used=$_used & $ran & "|"
$_jumble=$_jumble & $_letters[$ran]
EndIf
WEnd
return $_jumble & $_letters[$_letters[0]]
EndFunc
And here's one in AHK:
Code:
!RButton::
CoordMode, Mouse, Relative
MouseGetPos, inWinX, inWinY, WinId
if WinId =
return
WinGetPos, winX, winY, winW, winH, ahk_id %WinId%
halfWinW = %winW%
EnvDiv, halfWinW, 2
halfWinH = %winH%
EnvDiv, halfWinH, 2
if inWinX < %halfWinW%
MousePosX = left
else
MousePosX = right
if inWinY < %halfWinH%
MousePosY = up
else
MousePosY = down
CoordMode, Mouse, Screen
MouseGetPos, OLDmouseX, OLDmouseY, WinId
SetWinDelay, 0
Loop
{
GetKeyState, state, ALT, P
if state = U
break
GetKeyState, state, RButton, P
if state = U
break
MouseGetPos, newMouseX, newMouseY
if newMouseX < %OLDmouseX%
{
Xdistance = %OLDmouseX%
EnvSub, Xdistance, %newMouseX%
if MousePosX = left ; mouse is on left side of window
{
EnvSub, winX, %Xdistance%
EnvAdd, winW, %Xdistance%
}
else
{
EnvSub, winW, %Xdistance%
}
}
else if newMouseX > %OLDmouseX%
{
; mouse was moved to the right
Xdistance = %newMouseX%
EnvSub, Xdistance, %OLDmouseX%
if MousePosX = left ; mouse is on left side of window
{
EnvSub, winW, %Xdistance%
EnvAdd, winX, %Xdistance%
}
else
{
EnvAdd, winW, %Xdistance%
}
}
OLDmouseX = %newMouseX%
if newMouseY < %OLDmouseY%
{
Ydistance = %OLDmouseY%
EnvSub, Ydistance, %newMouseY%
if MousePosY = up ; mouse is on upper side of windows
{
EnvSub, winY, %Ydistance%
EnvAdd, winH, %Ydistance%
}
else
{
EnvSub, winH, %Ydistance%
}
}
else if newMouseY > %OLDmouseY%
{
Ydistance = %newMouseY%
EnvSub, Ydistance, %OLDmouseY%
if MousePosY = up ; mouse is on upper side of windows
{
EnvAdd, winY, %Ydistance%
EnvSub, winH, %Ydistance%
}
else
{
EnvAdd, winH, %Ydistance%
}
}
OLDmouseY = %newMouseY%
WinMove, ahk_id %WinID%,,%winX%,%winY%,%winW%,%winH%
}
return
As you can see, it's quite different. AHK may be simpler for beginners or people who've never programmed; AU3 would be more familiar for programmers, especially those who work with Visual Basic.
Also, AU3 is (presumably) older, is more mature, and has a much larger community then AHK (almost ten times larger!). AU3 even has merchandise!
If you want to directly compare the AU3 functions vs. AHK commands, here's the pages:
AU3 Functions
AHK Commands
One notable difference is that AU3 has supported expressions (complex and regular) for a while; AHK just started supporting basic expressions yesterday. This doesn't mean much to the every-day beginner, though.
Now for the big whammy, which usually is the deciding factor for people trying to decide between AU3 and AHK; AU3 is made more for in-depth and general scripting, while AHK leans more towards user interaction,
especially in the area of hotkeys (as the name implies). It's much easier to work with hotkeys (and other forms of user interaction) in AHK; in fact, AU3 doesn't even support as many hotkeys as AHK! I pulled this from the AU3 online documentation:
Quote:
The following hotkeys cannot be set:
- Single keys of a-z or A-Z. At least one Alt, Ctrl, or Win modifier is required with these keys.
- Ctrl+Alt+Delete It is reserved by Windows
- F12 It is also reserved by Windows, according to its API.
- NumPad's Enter Key Instead, use {Enter} which captures both Enter keys on the keyboard.
- Win+B,D,E,F,L,M,R,U; and Win+Shift+M These are built-in Windows shortcuts. Note: Win+B and Win+L might only be reserved on Windows XP and above.
- Alt, Ctrl, Shift, Win These are the modifier keys themselves!
- Other Any global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'.
And last but not least, if you
really can't decide, you could check out the editors supported by each. Understand that when I say "supported," I mean the ones that the installations include syntax files for, so the editor color-codes your syntax as you type it. If you don't know what that means, don't bother worrying about it.
AU3 Editors:
Scite
TextPad
Crimson Editor (free)
Source Edit (free)
UltraEdit
AHK Editors:
EditPlus
EmEditor
MED
PSPad
TextPad
AHK Editor (An AHK script, find on the forum)
So, if you already use one, it might be helpful to know if AHK or AU3 contains one.
And that's it! Well, actually, that's all I could find, really. If you want to look more into it yourself, here's some quick links to their respective pages:
AutoHotkeyAutoIt3P.S. You posted this in the wrong sub-forum; it'd probably be more appropriate in General Chat, or possibly Support.
P.P.S. to Chris: In my search, I noticed this:
Quote:
There will also be updates to the ActiveX and DLL versions of AutoIt called AutoItX3 - unlike v2 this will be a combined control (COM and standard DLL functions in the same DLL). AutoItX3 will allow you to add the unique features of AutoIt to your own favourite scripting or programming languages! (AutoItX3 is currently in beta, the files can be downloaded here).
Does this mean we will be able to use AutoIt3 from within AutoHotkey? I don't yet know much about dll's, but I would definitely be motivated to learn if that's what this meant.