go-autoit
go-autoit copied to clipboard
A wrapper of AutoIt (AutoItX) for the Go Programming Language.
go-autoit
A Go AutoItX wrapper.
##Sample code##
package main
import (
"fmt"
"github.com/brunoqc/go-autoit"
)
func main() {
success, pid := autoit.Run("notepad.exe", "", autoit.SwNormal)
if !success {
panic("can't run process")
}
fmt.Println("pid", pid)
}
##Build##
You need the DLL (AutoItX3.dll or AutoItX3_x64.dll for 64-bit) and the Swig executable in your PATH.
Note: I wasn't able to set CGO_CFLAGS to C:\Program Files (x86)\AutoIt3\AutoItX. It doesn't seem to like white spaces in the path so I copied the AutoItX directory to c:\
Note 2: swig seems to ignore CGO_CFLAGS so you may have to copy AutoItX3_DLL.h to the current directory.
set CGO_CFLAGS=-Ic:/AutoItX
set CGO_LDFLAGS=-Lc:/AutoItX -lAutoItX3_DLL
# (for 64-bit)
set CGO_LDFLAGS=-Lc:/AutoItX -lAutoItX3_x64_DLL
go build
