Skip to content

Port of AutoHotkey v2.0-a built-in functions for AHK v1.1+

Notifications You must be signed in to change notification settings

cocobelgica/AutoHotkey-Future

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

AutoHotkey v1.1 commands translated as functions using v2.0-a API.


Installation:

Copy the entire contents of Lib into a function library folder. Preferably in the user library: %A_MyDocuments%\AutoHotkey\Lib\\

Helpful links:

Translation rules (from changes):

  • If the command's first parameter is an output variable and the second parameter is not, it becomes the return value. Otherwise, RunWait and SendMessage return the value of ErrorLevel, and any other commands which set ErrorLevel return 1 on success and 0 on failure. ErrorLevel is still set as usual.
  • The remaining output variables are handled like ByRef parameters, except that an exception is thrown if the function is called incorrectly. Passing an empty string is equivalent to omitting the parameter, but any other value (which is not a variable reference) is not allowed.

Notes, limitations and todos:

  • ListVars() can only list global variables.
  • FileInstall() will only perform a FileCopy.
  • Gui("Add", ...) - the control's associated variable must be global. Declaring as static is currently impossible.
  • GuiControl() and GuiControlGet() can only operate on global variables(control's associated variable). Use ControlHwnd or ClassNN instead if needed.
  • Fix WinSetXXX() return values. In v2.0-a, ErrorLevel is returned. However, most of WinSet sub-commands in v1.1 do not use ErrorLevel. Perhaps ErrorLevel can be determined using A_LastError.
  • In v2, Func("MenuSelect").MinParams returns 0. However when called using command syntax, an error is thrown when a required parameter is omitted. There are probably other commands/functions that behave like this. Best to check using Func object properties.
  • Random() limitation -> how to mimic Random,, NewSeed?
  • This is just a rush job, perform proper tests.
  • Improve this README.

About

Port of AutoHotkey v2.0-a built-in functions for AHK v1.1+

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published