autohotkey / autohotkeydocs Goto Github PK
View Code? Open in Web Editor NEWDocumentation for AutoHotkey
Home Page: https://autohotkey.com/
Documentation for AutoHotkey
Home Page: https://autohotkey.com/
Own page for SubStr()
Template: Taken from: http://www.autohotkey.com/community/viewtopic.php?p=502134#p502134
Hi Lexikos,
don't know whether you read this: How can I contact you directly?
I want to discuss with you a little about current documentation. I'm willing to do a few "basic" enhancements on documentation and just want to be sure that my desired changes might be in your sense before doing all the work with risk to be rejected ...
Changes might include:
tag for HTML)
- Own page for "WinTitle" (Own page for "WinTitle" or better restructured "Last Found Window" page. As "WinTitle" is a parameter which is used by quite a few functions it deserves an own page, including examples.Doing this all functions having WinTitle as Parameter should refer to this new page. Redundant information on those function documentation pages should be removed or at least homogenized (each of those pages has a quite lengthy, redundant documentation on WinTitle)
- ...
Further changes might arise ...
I've set up a Trello-Board on Documentation-Rewrite Project (https://trello.com/board/documentation-rewrite/4ff142712c442e040466599d), already containing some basic questions and some ideas on what could be enhanced ,,,, (already invited Lexikos for discussion ...)
v2changes says that this command is removed, but it still shows up in the command list index:
Some of the example code in the v2 branch (e.g. Gui.htm) is indented with only two spaces. I have no problem with someone using this as their personal style, but in the documentation four spaces should be used.
@Ragnar-F, some of this was introduced by commit 3c1f901, but not all.
The Gui examples also contain some &
which should be &
.
"These scripts can be found at the AutoHotkey Community Forum" + link could be removed OR the link corrected to either the new forum or the same link where StrPutGet can be found for AutoHotkey Basic.
AHK-V2 Documentation
Command: BlockInput (page: commands\BlockInput.html)
Mode
1: One of the following words:
On or 1 (true): The user is prevented from interacting with the computer (mouse and keyboard input has no effect).
Off or 0 (false): Input is re-enabled.
Neither On nor Off are defined within AHK V2 (or at least they are not accessible within BlockInput)
Just use:
Mode
1: One of the following words:
True (1): The user is prevented from interacting with the computer (mouse and keyboard input has no effect).
False (0): Input is re-enabled.
Is there a reason why its named Functor?
The line in question: Scripts.htm#L146 (Permalink)
http://www.matcode.com/mpress.htm
is no longer online. MPRESS is under a pseudo-MIT license. That said, I have uploaded an archived version of the webpage with a copy of the download here:
Archived files: https://autohotkey.com/mpress/
Archived webpage: https://autohotkey.com/mpress/mpress_web.htm
If you search for "WinSet" or "WinGet" in the v2 docs, many of the links that appear in the search pane are broken and take you to an error page. This is because they are still pointing to WinSet.htm and WinGet.htm which no longer exist.
just me has found out that ErrorLevel:=""
causes the error "Illegal parameter name".
Should this be changed in the docs, or does the AutoHotkey code need to be modified to make it work this way? Actually, there's nothing wrong with using ErrorLevel as a parameter name.
In /docs/Hotkeys.htm
under the section "Alt-Tab Hotkeys" it says "Here is the complete list [of AltTab commands]", but the following list is missing AltTabMenu
. The example right afterwards uses it, but it does not appear in the list.
the lines of code I'm referencing
This does also apply to the v2
branch, as can be seen here.
Some longer strings in the side navigation elements lack space characters causing overflow.
One of many cases:
Mouse and Keyboard > Hotkeys and Hotstrings > Send/SendRaw/SendInput/SendPlay/SendEvent
Comma separated feels more elegant and technically saves a few bytes 👍:
Download link to notepad++-dbgp plugin within page docs/AHKL_DBGPClients.htm - chapter "Notepad++ DBGp Plugin" points to page which no longer exists
--> Provide a corrected link!
It appears that actual NumLock key is missing from the key list page. I'm not sure where it should go, maybe at the top of the numpad keys?
View -> Content, Index, Search, (and Favorites?) all cannot be manually selected.
Guest in http://ahkscript.org/boards/viewtopic.php?f=13&t=1434:
https://github.com/Lexikos/AutoHotkey_L ... ex.htm#L20
The Forum link goes to http://www.auto-hotkey.com/boards/ suggest to change to ahkscript.org
http://www.ahkscript.org/docs/misc/Macros.htm
The -- Home -- link goes to http://www.auto-hotkey.com/ suggest to change to ahkscript.org
http://www.ahkscript.org/docs/AHKL_Features.htm
double home - once is probably enough :-)
The definition (yellow box) for the following commands, doesn't show parentheses around the parameters, but the examples at the bottom of the page uses parentheses.
https://lexikos.github.io/v2/docs/commands/ClipWait.htm
https://lexikos.github.io/v2/docs/commands/ComObjConnect.htm
https://lexikos.github.io/v2/docs/commands/ControlSetStyle.htm
https://lexikos.github.io/v2/docs/commands/ControlSetText.htm
https://lexikos.github.io/v2/docs/commands/DriveEject.htm
https://lexikos.github.io/v2/docs/commands/DriveLock.htm
https://lexikos.github.io/v2/docs/commands/DriveSetLabel.htm
https://lexikos.github.io/v2/docs/commands/DriveUnlock.htm
https://lexikos.github.io/v2/docs/commands/ImageSearch.htm
https://lexikos.github.io/v2/docs/commands/OnClipboardChange.htm
https://lexikos.github.io/v2/docs/commands/OnExit.htm
https://lexikos.github.io/v2/docs/commands/PixelSearch.htm
https://lexikos.github.io/v2/docs/commands/ProcessSetPriority.htm
https://lexikos.github.io/v2/docs/commands/WinSetTitle.htm
https://lexikos.github.io/v2/docs/commands/WinWait.htm
https://lexikos.github.io/v2/docs/commands/WinWaitActive.htm
https://lexikos.github.io/v2/docs/commands/WinWaitClose.htm
And the command: https://lexikos.github.io/v2/docs/commands/NumGet.htm
has parentheses in the definition, but NumPut doesn't:
https://lexikos.github.io/v2/docs/commands/NumPut.htm
https://lexikos.github.io/v2/docs/objects/Object.htm#RawSet
doesn't show parentheses but the other obj commands on the same page do.
The definitions for some commands are shown both with and without parentheses:
https://lexikos.github.io/v2/docs/commands/Gosub.htm
https://lexikos.github.io/v2/docs/commands/Goto.htm
so maybe parentheses are optional for some commands.
Language.htm says:
The most common form of dynamic variable reference is called a double reference or double-deref.
Shouldn't that be called a double dereference?
Can we add another comment to the Sender.ahk Example? Specifically the line:
SendMessage, 0x4a, 0, &CopyDataStruct,, %TargetScriptTitle% ; 0x4a is WM_COPYDATA. Must use Send not Post.
Recently I needed to extend the timeout past the default (which I think is 5 seconds) for the child script to complete an operation before returning errorlevel to the master. Took a long time and someone else's example to find out that you could indeed set a timeout instead of the default. So I thought it might be helpful for other users.
Obviously word it however you like but I thought perhaps something like this:
SendMessage, 0x4a, 0, &CopyDataStruct,, %TargetScriptTitle%,,,,%Timeouttime% ; 0x4a is WM_COPYDATA. Must use Send not Post.
and maybe on a line before that something like:
Timeouttime = 5 ; Time to wait in seconds for Receiving script to return errorlevel
Referring to: https://trello.com/c/fXNEqZQH/21-merge-some-ahk-faq-content
How do you think about to integrate the unofficially FAQ by faqbot to the official help directly? It would be a great addition and give me the reason to translate it into German. I would undertake this task, if you and faqbot are okay with this.
I have attached a screenshot. The 'Select code" and "download code" buttons are also tiny.
AEI System info:
AutoHotkey : v1.1.27.07 Unicode 64-bit (Installed)
SystemModel : Precision 5510
SystemCPU : Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
SystemGPU : Intel(R) HD Graphics 530 v22.20.16.4836 @ 1024.00 MB RAM
SystemType : x64-based PC
SystemRAM : 16204 MB
SystemOS : 10.0.16299 64-bit v10.0.16299 (WIN32_NT)
SystemUptime : 3 days 9 hours 3 mins 33 seconds
SystemLocale : en-CA (0x0409)
SystemScreen : 4800x2700 (240 DPI)
A_AhkPath : C:\Program Files\AutoHotkey\AutoHotkey.exe
Ahk_CompilerPath : C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe
Ahk_WindowSpyPath : C:\Program Files\AutoHotkey\AU3_Spy.exe
MPRESS_IsPresent : 0 (false)
I'm posting this for my dad who doesn't have a GitHub account:
Dear Autohotkey,
The documentation page of autohotkey.com can not be loaded on a Windows machine. It gives trouble on IE, FF and Chrome. On any other platform Android, Linux, MacOS, the site loads normal[ly].
He showed me the problem: when he goes to autohotkey.com on a Windows laptop and clicks the Documentation link on top, the resulting page just keeps refreshing endlessly. He said the problem also occurred on the Windows computer he has at work. I hope you'll be able to reproduce the problem; let me know if you can't.
On the download page
https://autohotkey.com/download/
The link for the installer "extract to" link is
https://autohotkey.com/docs/Scripts.htm#install
but it should now be
https://autohotkey.com/docs/Program.htm#install
Reference: https://autohotkey.com/docs/Functions.htm#lib
The list of libraries has:
%A_ScriptDir%\Lib\ ; Local library - requires [v1.0.90+].
%A_MyDocuments%\AutoHotkey\Lib\ ; User library.
path-to-the-currently-running-AutoHotkey.exe\Lib\ ; Standard library.
but shouldn't that third line be something like:
directory-of-the-currently-running-AutoHotkey.exe\Lib\` ; Standard library.
or even:
% StrReplace(A_AhkPath, "AutoHotkey.exe", "Lib\") ; Standard library
EDIT: Apologies, I just now noticed the Docs suggestions on the forum. I'd delete this if I could but otherwise I'll be posting these sorta things there because filing an issue on Github doesn't seem like the better way to go about it.
Hello, Im graphic designer. I want to submit new logo for your project: AutoHotkey_L, I've see your master repo and didn't see Issues tab, so I come here.
May I? Dont think about anything, this is free. :)
I'm not professional AHK programmer, but from my point of view, at least one example in KeyWait page is misleading, because:
Yeah, I've heard of this mistake being made before... perhaps the docs need to have a note in there about how it waits for the key to be in the up state, rather than an up action. - camerb (moderator)
https://autohotkey.com/board/topic/66488-keywait-not-waiting/
Here is current example from docs:
~CapsLock::
KeyWait, CapsLock ; Wait for user to physically release it.
MsgBox You pressed and released the CapsLock key.
return
In the example above, we could use any key in the KeyWait line, and it will not change anything. Here it is:
; Press CapsLock and you will see message box, despite you have "keywait, z"
~CapsLock::
KeyWait, z ; Wait for user to physically release it.
MsgBox You pressed and released the CapsLock key.
return
And here is my own example. From my point of view, it's correct and not misleading:
keyWait, lButton, d
keyWait, lButton
soundBeep, 300, 300
return
I don't sure, though.
http://ahkscript.org/docs/Functions.htm#Other_Functions
Making a local copy on ahkscript.org would be preferable. All that, since autohotkey.net is dead and etc...
atnbueno in http://ahkscript.org/boards/viewtopic.php?f=14&t=1169
In the Script Compatibility documentation, if I understand the purpose of the t_size function, the output is reversed:
http://docs.ahkscript.org/Compat.htm#NumPutGet
http://l.autohotkey.net/docs/Compat.htm#NumPutGet
Shouldn't it be like this?
t_size(char_count=1) {
return A_IsUnicode ? char_count*2 : char_count
}
One of my favorite features of Travis CI's online documentation is a small button on every page that allows readers to easily suggest improvements to the current page on GitHub.
I would like to suggest a similar button be added to the documentation for AutoHotkey.
I believe that adding a "edit on GitHub" button would make the process of contributing to AHK much simpler for new potential contributors.
Own page containing all mathematical functions
Hi,
At the end of documentation page:
https://autohotkey.com/docs/commands/SetNumScrollCapsLockState.htm
It is written:
"Remarks
A key can also be toggled to its opposite state via the Send command; for example: Send {CapsLock}."
This does not work with AHK v 1.30.0.0.
The following file swaps LCtrl with CapsLock and tries to circumvent Windows' dirty hardcoded mapping of AltGr to LControl+RAlt.
As the code does not behave similarly with Send {CapsLock} or with manual toggling of CapsLock status, there's a bug either in the code or the documentation...
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CalledFromRWin := 0
; Disable AltGr
LControl & RAlt::
; Simulate AltGr on RWin
RWin::
CalledFromRWin := 1
Send, {LControl down}{RAlt down}
Sleep 500
Send, {RAlt up}{LControl up}
CalledFromRWin := 0
Return
; Swap LCtrl & CapsLock
CapsLock::LCtrl
LControl::
;MsgBox, "%CalledFromRWin%"
If (CalledFromRWin == 0) {
Send {CapsLock} ;;;; <--- using this DOES NOT work, but following lines DO!
;if GetKeyState("CapsLock", "T") = 1 {
; SetCapsLockState, off
;} else if GetKeyState("CapsLock", "T") = 0 {
; SetCapsLockState, on
;}
}
Return
The edit command page has a link to isense which is outdated (code works only for Basic)
https://github.com/Lexikos/AutoHotkey_L-Docs/blob/9572b8ace07551af86fe1af1b6ee79beaaad17d9/docs/commands/Edit.htm#L20
It could either be replaced by a global link to the Editors section saying something like
Various scripts to assist with writing code in any editor are available in the Editor section of the forum.
or you could list two specific scripts:
Insert AHK Command/Function Parameters (with Search/Auto-Complete)
https://autohotkey.com/boards/viewtopic.php?f=60&t=31484[Hotstrings] Expand parameters for AHK's functions, commands and directives.
https://autohotkey.com/boards/viewtopic.php?f=60&t=27882
if %x%
msgbox %x%
while %x%
are easily confused with poor consistency
Not mentioned in the document (except for Changes & New Features).
example 1
qq=4
q::
while %qq%
{
qq -=1
msgbox %qq%
}
return
example 2
qq=4
q::
if %qq%
{
qq -=1
msgbox %qq%
}
return
example 3
qq=4
q::
while % qq
{
qq -=1
msgbox %qq%
}
return
example 4
qq=w
w=5
q::
while %qq%
{
qq -=1
msgbox %qq%
}
return
example 5
qq=w
w=5
q::
while % qq
{
qq -=1
msgbox %qq%
}
return
Shouldn't the shorthand be also mentioned on the Regexmatch page. Or maybe take the shorthand description to this page. Maybe just a simple link and a sentence where it's currently mentioned.
Hi,
your docs page looks very broken to me in firefox:
I traced the issue down to this code line:
If I execute document.scripts
in the firefox debugger, i get this result listing:
document.scripts
[…]
0: <script id="custom-useragent-string" type="text/javascript">
1: <script src="static/content.js" type="text/javascript">
2: <script type="text/javascript" src="/source/data_translate.js">
3: <script type="text/javascript" src="/source/data_toc.js">
4: <script type="text/javascript" src="/source/data_index.js">
5: <script type="text/javascript" src="/source/data_search.js">
"custom-useragent-string": <script id="custom-useragent-string" type="text/javascript">
The extension in question is custom-useragent-string but I guess there might be other extensions which would break your script code:
var scriptDir = document.scripts[0].src.substr(0, document.scripts[0].src.lastIndexOf('/'));
I think a fix might be easily possible but I do not have the picture, why you are using this approach and why you need scriptDir at all.
Good evening
We usually do not search for a specific string which should be highlighted,
but for an AutoHotkey command man page.
Therefore, we just search for e.g. clip
and then to click on Clipboard
.
Then, the result is very annoying: it feels like every 3rd word is partially highlighted which massively reduces the readability.
Therefore, we always manually delete the search word and reload the page, so that it looks and reads perfectly.
Therefore the question: is there a way to search for AutoHotkey commands without having everything highlighted in the result?
It's very hard to write scripts because of the non-intuitive syntax for the variable handling,
but after spending much time for try and error, the result is always great and gives amazing feedbacks :-)
First of all: Nice changes regarding the new menu object. Thanks.
But when it comes to documentation, I notice a discrepancy in the content separation of commands/Menu.htm compared to the content separation of commands/Gui.htm.
Currently, commands/Menu.htm has been split to objects/Menu.htm and commands/MenuCreate.htm, while commands/Gui.htm has been split to objects/Gui.htm, objects/GuiControl.htm and commands/GuiCreate.htm.
So far so good, but:
Compared to:
We should only choose one direction. I think that a better overview is given if commands/MenuCreate.htm contains the documentation about win32 menus, remarks, related and examples, while objects/Menu.htm focuses only on its object members, as it is already the case with the other objects/ pages.
Suggestion: Including a remark that If (Expression) is case insensitive. To make it case sensitive see StringCaseSense
Thanks! Jules
The new MsgBox help page still links to the old MsgBoxButtonNames script . Perhaps you want to remove that link or update that script with the new v2 syntax
Haven't looked at the docs for a while... Nice work with the settings. 👍
What is the minimum targeted width (iPhoneSE/5 is 320px)? The icons overflow onto the documentation content area.
A simple fix would be to add a conditional css style like so (without affecting the current style too much):
@media screen and (max-width: 343px) {
#head .h-tools ul {
width: 3.25em;
}
}
Another minor issue on mobile phones is that the icons get shoved behind the side-menu when it is opened. Part of the gear icon is visible floating on the documentation content area. Possibly, to get around this, a display:none;
could be added to .h-tools > .main
and .h-tools > .online
.
The Delete
method states:
Deletes a menu item or all custom menu items.
If MenuItemName is omitted, all custom menu items are deleted from the menu, leaving the menu empty unless it contains the standard items.
However, calling A_TrayMenu.Delete()
does delete all standard menu items. I'm not sure on how best to reword it but wanted to bring it up.
The docs is currently using "ISO-8859-1" instead of "UTF-8". Is there a particular reason for this?
Currently the docs' search box does not work because the key name mört
within var SearchIndex
(near "mywindowtitle") is being loaded as mört
instead in this file . This flags an invalid character error, and so on:
SyntaxError: illegal character @ data_search.js:1:157034
ReferenceError: SearchIndex is not defined @ content.js:111:7
I have double checked that the files on the server are encoded as UTF-8 without BOM (content.js is ASCII since there are no unicode chars used).
Do 'Up' hotkeys use the keyboard hook?
I ask because it doesn't look like the Send
command triggers them:
var := 0
a up::
var++
tooltip, % "var=" var
if (var > 0)
Send, {a up}
return
That hotkey does not recursively trigger itself. However, if you change both the Definition and the Send command to both use a
instead of a up
, then the hotkey does trigger itself.
If 'Up' hotkeys do use the hook, I think that note should be added to the docs in the 'Up' block:
https://autohotkey.com/docs/Hotkeys.htm
And if so, does that mean a corresponding normal/down hotkey also uses the hook if it were defined in the same script?
Merged into AutoHotkey/Ahk2Exe since v1.1.22.03.
Maybe a mention of the error codes (ErrorCodes.md) would be nice.
On this page, http://ahkscript.org/docs/Scripts.htm#ahk2exe
HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
This error appears when one uses Go -> URL... or Home Page on XP/IE8. I'm guessing that it is due to the IE version, not the OS version.
The error dialog shows line 0, and seems to appear after the script executes, not during. I was unable to determine which part of the code causes it.
@Ragnar-F, can you look into this?
If you do any testing, pull down commit 7a05237 first.
Entry "WinExist" is missing on page "Alphabetical Command and Function Index"
The manual page for RegisterCallback contains the following snippet of code:
DllCall("GlobalFree", "Ptr", Address)
However, MSDN defines GlobalFree as follows:
HGLOBAL WINAPI GlobalFree(
__in HGLOBAL hMem
);
HGLOBAL is a HANDLE, which is of type Ptr. I suggest the RegisterCallback snippet be updated as follows:
DllCall("GlobalFree", "Ptr", Address, "Ptr")
When profiling the docs in devtools you can see ~450ms is spent on assigning event listeners, 99.9% of which won't be used 99.9% of the time the docs are used either online or in a local help file.
I guess the proper solution is to use event delegation and attach the listeners to just one parent element, however even postponing via setTimeout would greatly improve the initial responsiveness of all help pages, which is especially important in the local help file where the initial delay is really noticeable compared to all other standard CHM files even on a superfast 4GHz i7 PC.
This applies to both online and offline help. For example, when searching for "concepts", the new page "Concepts and Conventions" will not be found. Maybe you should adjust your release preparing script to run build_search.ahk beforehand (or something like that).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.