Skip to content

Instantly share code, notes, and snippets.

;*******************************************************
; 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
#NoEnv
SetBatchLines -1 ;run as fast as possible
;~ DetectHiddenWindows, On
;~ ListLines On ;on helps debug a script
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
;~The script needs to be run at an elevated level- this takes care of that
if (! A_IsAdmin){ ;http://ahkscript.org/docs/Variables.htm#IsAdmin
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}
data=
(
one two three
one two 3
two two 4
three two 6
)
;*********Use For loop over Var going line by line*********************
for i, row in Loopobj:=StrSplit(data,"`n","`r`n") { ;Parse Var on each new line
#IfwinActive, Messaging | LinkedIn - Google Chrome
::smsg::
clipboardOld:=ClipboardAll
Clipboard:="Send Hello,`nThanks for reaching out and connecting. "
. "I am always happy to make new connections here on LinkedIn. "
. "Although, I find sales messages a bit intrusive and drain my valuable time."
. "So, I am delighted to stay connected, but any more sales messages will, unfortunately, "
. "result in me blocking you.`n`nThanks`nMatthew"
send ^v
sleep, 100 ;always pause after pasting and before restoring clipbooard
;****************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
;********************GrepWin Listview***********************************
;~ ; Get the row of first selected item in listviewi
ControlGet,Var,List,Selected,SysListView321,ahk_exe ahk_exe grepWin-1.9.1_portable.exe
ControlGet,Var,List,Count,SysListView321,ahk_exe ahk_exe grepWin-1.9.1_portable.exe
MsgBox % var
;********************Getting specific columns / rows***********************************
;*******************************************************
; 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
;*******************************************************
ControlSetText,ComboBox1,Cool,ahk_exe notepad.exe ;Set Text
ControlSetText,Edit1,Cool,ahk_exe notepad.exe ;Set Text
ControlSetText,Sample,This is Cool,ahk_exe notepad.exe ;Set Text
ControlGetText,Var,ComboLBox1,Font ahk_exe notepad.exe ;Get Text
ControlGet,var,Choice,,ComboLBox1,ahk_exe notepad.exe
MsgBox % Var
;*******************************************************
; 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
;*******************************************************
ControlSetText,ComboBox1,Cool,ahk_exe notepad.exe ;Set Text
ControlSetText,Edit1,Cool,ahk_exe notepad.exe ;Set Text
ControlSetText,Sample,This is Cool,ahk_exe notepad.exe ;Set Text
ControlGetText,Var,ComboLBox1,Font ahk_exe notepad.exe ;Get Text
ControlGet,var,Choice,,ComboLBox1,ahk_exe notepad.exe
MsgBox % Var
ControlSetText,ComboBox1,Cool,ahk_exe notepad.exe ;Set Text
ControlSetText,Edit1,Cool,ahk_exe notepad.exe ;Set Text
ControlSetText,Sample,This is Cool,ahk_exe notepad.exe ;Set Text
ControlGetText,Var,ComboLBox1,Font ahk_exe notepad.exe ;Get Text
ControlGet,var,Choice,,ComboLBox1,ahk_exe notepad.exe
MsgBox % Var
ControlSend,ComboBox1,Just a test,ahk_exe notepad.exe ;Sending keystrokes
ControlSendRaw,ComboBox1,Just a test!,ahk_exe notepad.exe ;Sending keystrokes
#NoEnv
#SingleInstance force
ToolTipDuration := 2000
;Set up for MSWORD for testing only.
;Three issues with the script
;1 - SaveWindow sometimes doesn't refocus as expected ---
;2 - Escaping causes the Tooltip to show the last saved; would like to remove that ---