Skip to content

Instantly share code, notes, and snippets.

@G33kDude
Last active August 2, 2022 23:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save G33kDude/d3d9e4fd7c739dab3527 to your computer and use it in GitHub Desktop.
Save G33kDude/d3d9e4fd7c739dab3527 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Code box to CodeQuickTester
// @namespace https://github.com/G33kDude
// @version 0.6
// @description Adds a button to open AHKScript code boxes in CodeQuickTester
// @author GeekDude
// @match *://autohotkey.com/boards/viewtopic.php*
// @grant none
// @updateURL https://gist.github.com/G33kDude/d3d9e4fd7c739dab3527/raw/CodeBox2QuickTest.user.js
// ==/UserScript==
$(".codebox_plus > p > a:contains('Download')").each(function(i, e) {
$(e).after(
" ",
$("<a>[Open]</a>").attr("href", "ahk:" + e.href)
);
});
$(".post_gist_toggle").after(
"&nbsp;",
$("<input type='button' value='Open' />")
.attr("style", $(".post_gist_toggle").attr("style"))
.on("click", function (){
window.location = "ahk:" + $(this).next().find("a").attr("href");
})
);
@TFWol
Copy link

TFWol commented Aug 2, 2022

Hello, I'm trying to get this to work again.

I've got the [Open] button to reappear by prepending www. on L7's URL and changing L12 to:

$(".codebox > p > a:contains('Download')").each(function(i, e) {

Right now, CodeQuickTester opens up filled with the page html.
I'm not entirely sure how to pass in the codebox content.

I find this tool very useful and would like to have that extra convenience.
Any plans on tweaking the code a bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment