Bookmarklets, Firefox, AutoHotKeys & maybe MaxLauncher too
I’ve a few bookmarklets that I think are great, but I don’t use as frequently as I would like to because I forget they are there to be used. A bit of an issue with me, I find interesting things but forget to use them sufficiently to get the most out of them.
So they need to be in a place where they work in with my current workflow. Which, at the moment, is exploring things in AutoHotKey. Another topic I’m exploring is MaxLauncher as it’s a free Stream Deck “pale imitation” substitute that I’m trying to get functioning as well as my $300NZ Stream Deck.
So I’d like to have bookmarklet buttons for my browser that sit on a key in MaxLauncher. To do this I want a ahk script to be called that will make that bookmarklet act on a specific web page.
As bookmarklets are javascript scripts that overlay and modify existing web pages you need to find 1. The web page tou want, then apply the bookmarklet to it. The usual method is, once the page is opened you then press a bookmark on your bookmark tab in your browser and that javascript script is run on top of that URL.
All well and good. But how to do get that to work in MaxLauncher?
Not so difficult as it happens inside Firefox browser, as Firefox allows you to have

So no need to type all the bookmarklet javascript into the address bar.
To focus on the address bar you can use the hotkey CTRL + L. If you are in Firefox this will immediately move the cursor into the address bar.
So, having these 2 features of Firefox we can now write a AutoHotKey script that will allow us to activate a bookmarklet on a webpage thusly:
#SingleInstance force
WinActivate, firefox
send, ^l
; send, {Right 2}
send, hi
send, {enter}
; InputBox, Query, What to Highlight, What is query?
; send, {enter}
Return
And so the ahk script can be assigned to a key on MaxLauncher and the bookmarklet can be run on a webpage using MaxLauncher



End comment
I thought this was going to be a tortuous procedure but in Firefox it ended up being pretty easy with the keyword for bookmarks