Skip to content

Instantly share code, notes, and snippets.

;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey courses.
;They're structured in a way to make learning AHK EASY: https://the-Automator.com/Learn
;*******************************************************
SetBatchLines,-1
#SingleInstance,Force
;********************Excel Safe array***********************************
XL:=XL_Handle(1) ;Connect to Excel
sArr :=xl.Range["a1:L29"] ;Store the content of the array into sArr
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey courses.
;They're structured in a way to make learning AHK EASY: https://the-Automator.com/Learn
;*******************************************************
#SingleInstance,Force ;only allow one instance
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SetBatchLines,-1 ;run the script as fast as possible
Setkeydelay,0 ;reduce key delay to smallest time period
SetWorkingDir, %A_ScriptDir% ; Ensures a consistent starting directory.
SendMode, Input ; Recommended for new scripts due to its superior speed and reliability.
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey courses.
;They're structured in a way to make learning AHK EASY: https://the-Automator.com/Learn
;*******************************************************
#Include <default_Settings>
;**************************************
/*
Tick:=A_TickCount
FileRead,Text,%A_AhkPath%\..\License.txt
m(A_TickCount-Tick)
#Requires AutoHotkey v1.1.33+
#requires 32 bit version of AutoHotkey
MsgBox % URiEncode("https://the-Automator.com?Src=news&id=1211")
uriDecode(str) {
Loop
If RegExMatch(str, "i)(?<=%)[\da-f]{1,2}", hex)
StringReplace, str, str, `%%hex%, % Chr("0x" . hex), All
Else Break
;****************copy path of file selected to clipboard***************************************
#IfWinActive ahk_class CabinetWClass ;Explorer window
^+c:: ;Copy explorer path to clipboard
clipboard = ; Empty the clipboard
SendInput , ^c ;changd from Send 11/23
ClipWait, 1
If ErrorLevel ;Added errorLevel checking
{
MsgBox, No text was sent to clipboard
Return
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code here: https://the-Automator.com/Learn
;*******************************************************
#SingleInstance Force
^g:: ;Control G pastes plain text
Store:=ClipboardAll ;Store full version of clipboard
ClipBoard := ClipBoard ; Convert to plain text
Sleep, 50
SendInput, ^v ;paste plain text
;~ #Include <default_Settings>
#SingleInstance,Force
;**************************************
SetTitleMatchMode 2
OBJID_NATIVEOM := -16
;********************if Word is active***********************************
ControlGet, hwnd, hwnd, , % "_WwG1", % "- Word ahk_class OpusApp" ;identify the hwnd for Word
;********************Now apply to which ever one is active***********************************
var=
(
Email First_Name Last_Name
joejunkemail@yahoo.com Joe King
Joe@the-Automator.com Joseph GLines
)
;*********Use For loop over Var going line by line*********************
for i, row in Loopobj:=StrSplit(var,"`n","`r`n") { ;Parse Var on each new line
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code here: https://the-Automator.com/Learn
;*******************************************************
#MaxThreadsPerHotkey, 2 ;https://www.autohotkey.com/docs/commands/_MaxThreadsPerHotkey.htm
Tooltip, Toggle %Toggle%
^t::
;**************************************
toggle :=!Toggle ;Set toggle to not be toggle
Tooltip, Toggle here: %Toggle%
#SingleInstance,Force
Var:="hello"
^t::
MsgBox % var
return
^q::
MsgBox % var