• Intro to AutoHotkey HotStrings with AutoHotkey Intermediate AutoHotkey GUIs are Easy with AutoHotkey Intro to DOS & AutoHotkey

HotString to bring up a GUI with multiple text selections in AutoHotkey

I was helping someone in an AutoHotkey Facebook group this morning.  The original request was how to have a HotString without requiring an ending character (tab, space, return, etc.).  This is solved by simply putting an asterisk in between the first two colons.

i.e.  :*:jg::Joe@the-Automator.com

However someone else mentioned a function they use to display a list of items and select from them.  He didn’t share his function but I found something similar on the AutoHotkey forum.   The example used the “Loop” and StringSplit commands.  I decided to adapt it to use a for Loop and StrSplit function.

HotString to bring up a GUI with multiple text selections in AutoHotkey

Here’s the code to use a HotString to bring up a GUI with multiple text selections in AutoHotkey


#SingleInstance,Force ;make sure it only runs once
:*:jg::Joe@the-Automator.com ;This does solve initial request

:*:gg:: ;when I type gg bring up the menu (* means don't wait for an end charachter)
TextMenu("This is, cool¦But I like¦to do more¦with these¦But that's about`n`nit")
return
:*:ff:: ;when I type gg bring up the menu (* means don't wait for an end charachter)
TextMenu("this¦is from the ¦ff choice I typed¦Pretty cool¦huh")
return

TextMenu(TextOptions){
for k, MenuItems in StrSplit(TextOptions,"¦") ;parse the data on the weird pipe charachter
Menu, MyMenu,Add,% MenuItems,Action ;Add each item to the Menu

Menu, MyMenu, Show ;Display the GUI and wait for action
Menu, MyMenu, DeleteAll ;Delete all the menu items
}

Action:
ClipboardBackup:=ClipboardAll ;backup clipboard
Clipboard:=A_ThisMenuItem ;Shove what was selected into the clipboard
Send, ^v ;paste the text
sleep, 50 ;Remember to sleep before restoring clipboard or it will fail
Clipboard:=ClipboardBackup ;Restore clipboard
return

 

Web Scraping with AutoHotKey 101-Super simple ways to Get data from a page, handles & pointers

Web Scraping with AutoHotKey

Web Scraping with AutoHotkey: Intro

Being able to, programatically, navigate to an Internet page and scrape the contents in a reliable fashion is best things invented since sliced bread!   I spent years manually going through pages and copying/pasting contents from IE to Excel then spent even more time trying to clean it up.  Done properly you can get the data very, very close to how it is on the web with little effort.

The below video walks through using AutoHotKey to obtain basic values from a Web page.  It also demonstrates a script I wrote that helps write the syntax (yes I’m that lazy!)  The AutoHotKey script I wrote is further down this page and can also be found on the AHK forum here.

In this beginning tutorial I how to:
1) get a pointer to IE
2) navigate to a page
3) get text from a page

Web Scraping Intro with AutoHotkey

Here is the script writer to use during your web scraping intro with AutoHotkey.
Web Scraping with AutoHotKey

AutoHotKey Menu Builder- save hours of time by streamlining menu creation

AutoHotKey menu builderAHK is simple enough for me, an non-programmer, to program in however their GUIs are very tricky.  I wrote an AutoHotKey menu builder to help automate the building of them.  This can save a lot of time when trying to build menus.

Just remember that sub-menus need to be placed above their parents!  This always confused me because I wanted to put them below their parent’s .  You can also review this video which helps educate you on some of the built in features of AHK to control GUI placement

AutoHotKey Menu Builder

  • Intro to AutoHotkey HotStrings with AutoHotkey Intermediate AutoHotkey GUIs are Easy with AutoHotkey Intro to DOS & AutoHotkey