Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
JoeGlines / Handling_EventListeners_and_Custom_Edit_boxes.ahk
Last active April 26, 2021 15:53
Handling Event Listeners & Custm edit boxes
;*******************************************************
; 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
#Include
;**************************************
page:=Chrome.GetPageByURL("http://www.gethifi.com/tools/regex","startswith") ;This will connect to the second index of a specific tab
If !IsObject(page){
MsgBox % "That wasn' t object / the page wasn't found"
@JoeGlines
JoeGlines / Large_file_peak.ahk
Last active April 26, 2021 15:53
Peak inside large files and see headers plus # of 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
;*******************************************************
#SingleInstance,Force
Browser_Back::
SetBatchLines,-1 ;Set run w/o any sleeping between things
#MaxMem,4095 ;Increase the variable allowance to max just in case a massive file
;***********Get row count of file and display headers*******************
Path:= Explorer_GetSelected() ;Explorer Function that gets paths of selected files
@JoeGlines
JoeGlines / Builtin_Variables.ahk
Created June 1, 2020 23:14
Just some of the cool built-in variables
;~ #Include <default_Settings>
;**Built in variables https://www.autohotkey.com/docs/Variables.htm#BuiltIn ***
:o:vcn.::
Send % A_ComputerName ;Sends computer name
return
:o:vun.::
send % A_UserName
return
@JoeGlines
JoeGlines / Sending large text.ahk
Last active April 26, 2021 15:52
Automate sending large amounts of text with a Hotkey
;*******************************************************
; 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
;*******************************************************
#Include <default_Settings>
;**************************************
^+r::
text=
(
Here are the requirements. Let me know if you’re still interested & We’ll figure out a time you can see it.
@JoeGlines
JoeGlines / First_to_Last.ahk
Created June 1, 2020 23:48
Get the text of the First selected item and the Last selected item
Get the text of the First selected item and the Last selected item
@JoeGlines
JoeGlines / Long_press_kill_Active_Program.ahk
Last active July 27, 2022 18:33
use the escape key to close the active program
;*******************************************************
; 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
;*******************************************************
;~ http://www.autohotkey.com/board/topic/80697-long-keypress-hotkeys-wo-modifiers/
~$Esc:: ; Long press (> 0.5 sec) on Esc closes window
KeyWait, Escape, T0.5 ; Wait no more than 0.5 sec for key release (also suppress auto-repeat)
If ErrorLevel ; timeout, so long press
PostMessage, 0x112, 0xF060,,, A ;Use PostMessage to close window
Return
@JoeGlines
JoeGlines / pathToFile.ahk
Last active April 26, 2021 15:52
get path to selected file
;*******************************************************
; 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 ;AutoHotkey Webinar
#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
@JoeGlines
JoeGlines / QueryString_Builder.ahk
Last active October 6, 2021 16:39
A function to build query strings for API calls
;*******************************************************
; 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
;*******************************************************
QueryString_Builder(x){
for a,b in x
String.=(A_Index=1?"?":"&") a "=" b
return String
}
@JoeGlines
JoeGlines / WinHTTPRequest.ahk
Last active September 5, 2023 02:40
Example WinHTTPRequest for API call
;*******************************************************
; 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
;********************WinHTTP request***********************************
HTTP:=ComObjCreate("WinHttp.WinHttpRequest.5.1") ;Create COM Object
HTTP.Open("GET","https://www.autohotkey.com/boards/memberlist.php?mode=viewprofile&u=114")
HTTP.SetRequestHeader("Cookie","_ga=GA1.2.948743824.158940030; __cfduid=d6e365bic6b23f55d1c04595b6935256e01591460854; _gid=GA1.2.1697507601.1591460855; phpbb3_ghjir_u=114; phpbb3_ghjir_k=dc1bc7e06bf11a1b; phpbb3_ghjir_sid=253b7ed833a562970bdbc8fe7357e4da")
HTTP.SetRequestHeader("User-Agent","Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko")
@JoeGlines
JoeGlines / Msxml2_Request.ahk
Last active April 26, 2021 15:51
Example using the Msxml2 Com object for an API Request
;*******************************************************
; 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
;*******************************************************
;***********msXML2 XMLHttp Request XHR https://en.wikipedia.org/wiki/XMLHttpRequest*******************
XHR:=ComObjCreate("Msxml2.XMLHTTP") ;https://msdn.microsoft.com/en-us/library/ms535874(v=vs.85).aspx
;open parameters( Method, URL, Asynchronous, UserName, Password )
XHR.Open("GET","https://www.autohotkey.com/boards/memberlist.php?mode=viewprofile&u=114",False)
XHR.Send()
while(XHR.ReadyState!=4) ;Wait for it to complete