Skip to content

Instantly share code, notes, and snippets.

@davebrny
Last active August 27, 2023 08:01
Show Gist options
  • Save davebrny/e1102636e46db1293831aea63cabe485 to your computer and use it in GitHub Desktop.
Save davebrny/e1102636e46db1293831aea63cabe485 to your computer and use it in GitHub Desktop.
πŸ“œ (autohotkey) - script settings to be included in your main script or just used as a quick reference
; name ; options (* means default) ; description
; ------------------------------ ; -------------------------------- ; ---------------------------------------------------------
; #ClipboardTimeout -1 ; -1|0|1000* (Milliseconds) ; Changes how long the script keeps trying to access the clipboard when the first attempt fails
; #CommentFlag ; NewString ; Changes the script's comment symbol from semicolon to some other string
; #ErrorStdOut ; ; Sends any syntax error that prevents a script from launching to stderr rather than displaying a dialog
; #EscapeChar ; NewChar ; Changes the script's escape character (e.g. accent vs. backslash)
; #HotkeyInterval ; 2000* (Milliseconds) ; Along with #MaxHotkeysPerInterval, specifies the rate of hotkey activations beyond which a warning dialog will be displayed
; #HotkeyModifierTimeout ; -1|0 (Milliseconds) ; Affects the behavior of hotkey modifiers: CTRL, ALT, WIN, and SHIFT
; #Hotstring ; NoMouse|EndChars NewChars|NewOptions ; Changes hotstring options or ending characters
; #IfTimeout ; 1000*| (Milliseconds) ; Sets the maximum time that may be spent evaluating a single #If expression.
; #InstallKeybdHook ; ; Forces the unconditional installation of the keyboard hook
; #InstallMouseHook ; ; Forces the unconditional installation of the mouse hook
; #InputLevel ; 0*|100 ; Controls which artificial keyboard and mouse events are ignored by hotkeys and hotstrings
; #KeyHistory 100 ; 0|40*|500 ; Sets the maximum number of keyboard and mouse events displayed by the KeyHistory window
; #MaxHotkeysPerInterval 200 ; 70* ; Along with #HotkeyInterval, specifies the rate of hotkey activations beyond which a warning dialog will be displayed
; #MaxMem ; 1|4095 (Megabytes) ; Sets the maximum capacity of each variable to the specified number of megabytes
; #MaxThreads 2 ; 2|10*|255 ; Sets the maximum number of simultaneous threads
; #MaxThreadsBuffer On ; On|Off* ; Causes some or all hotkeys to buffer rather than ignore keypresses when their #MaxThreadsPerHotkey limit has been reached
; #MaxThreadsPerHotkey ; 1*|255 ; Sets the maximum number of simultaneous threads per hotkey or hotstring
; #MenuMaskKey ; Ctrl*|KeyName ; Changes which key is used to mask Win or Alt keyup events
#NoEnv ; ; Recommended for performance and compatibility with future AutoHotkey releases
; #NoTrayIcon ; ; Disables the showing of a tray icon
; #Persistent ; ; Keeps a script permanently running (that is, until the user closes it or ExitApp is encountered)
; #SingleInstance, force ; [force|ignore|off] ; Determines whether a script is allowed to run again when it is already running
; #UseHook ; [On|*Off] ; Forces the use of the hook to implement all or some keyboard hotkeys.
; #Warn ; [WarningType, WarningMode] ; Enables or disables warnings for specific conditions which may indicate an error, such as a typo or missing "global" declaration
; #WinActivateForce ; ; Skips the gentle method of activating a window and goes straight to the forceful meth21st
; ------------------------------ ; -------------------------------- ; -----------------------------------------
; AutoTrim, Off ; On*|Off ; Determines whether Var1 = %Var2% statements omit spaces and tabs from the beginning and end of Var2
; CoordMode, ; ToolTip|Pixel|Mouse|Caret|Menu [, Screen*|Window|Client] ; Sets coordinate mode for various commands to be relative to either the active window or the screen
; Critial, ; Off*|Number ; Prevents the current thread from being interrupted by other threads
; DetectHiddenText, Off ; On*|Off ; Determines whether invisible text in a window is "seen" for the purpose of finding the window. This affects commands such as IfWinExist and WinActivate
; DetectHiddenWindows, On ; On|Off* ; Determines whether invisible windows are "seen" by the script. When "Off", hidden windows are not detected, except by the WinShow command
; Thread ; NoTimers|Priority|Interrupt ; Sets the priority or interruptibility of threads. It can also temporarily disable all timers
SendMode Input ; Input|Play|Event*|InputThenPlay ; Recommended for new scripts due to its superior speed and reliability)
; SetDefaultMouseSpeed, 0 ; 0|2*|100 ; Sets the mouse speed that will be used if unspecified in Click and MouseMove/Click/Drag
; SetFormat, ; NumberType, Format ; Sets the format of integers and floating point numbers generated by math operations
; SetStoreCapslockMode, Off ; On*|Off ; Whether to restore the state of CapsLock after a Send
; SetControlDelay, 0 ; -1|0|20* ; Sets the delay that will occur after each control-modifying command
; SetKeyDelay, 0 ; [, Delay, PressDuration, Play] ; Sets the delay that will occur after each keystroke sent by Send and ControlSend
; SetMouseDelay, 0 ; Delay [, Play] ; Sets the delay that will occur after each mouse movement or click
; SetWinDelay, 0 ; -1|0|100* ; Sets the delay that will occur after each windowing command, such as WinActivate
; SetBatchLines -1 ; -1|10ms*|20ms|LineCount ; Determines how fast a script will run (affects CPU utilization)
; SetBatchLines, ; [LineCount] ; The number of script lines to execute prior to sleeping for 10ms
; SetTitleMatchMode, 2 ; 1*|2|3|RegEx ; (match at start: 1, match anywhere: 2, exact match: 3) - Sets the matching behavior of the WinTitle parameter in commands such as WinWait
; SetTitleMatchMode, Slow ; Fast*|Slow ; One of the following words to specify how the WinText and ExcludeText parameters should be matched
SetWorkingDir %A_ScriptDir% ; DirName ; Ensures a consistent starting directory
; StringCaseSense, On ; On|Off*|Locale ; Determines whether string comparisons are case sensitive (default is "not case sensitive")
/*
[script info]
version = 1.3
description = full list of script settings. (#include this file into the auto-execute section and un-comment the ones you need
source = https://gist.github.com/davebrny/e1102636e46db1293831aea63cabe485
*/
@davebrny
Copy link
Author

davebrny commented Dec 28, 2016

usage

  • add this file to the start of your main script using the #include command
  • uncomment the settings you need
  • values with an * asterisk next to them are the default values

! some details/defaults in this script maybe incorrect. check out the official docs for the full descriptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment