Skip to content

Instantly share code, notes, and snippets.

@Lexikos
Lexikos / v1-in-v2.ahk
Created September 9, 2022 23:45
Use AutoHotkey v1 libraries in a v2 script by making use of AutoHotkey.dll
; Example 1: Add some code and import a function.
v1 '
(
MakeProgress(Param1:="", Sub:="", Main:="", Title:="", Font:="") {
Progress % Param1, % Sub, % Main, % Title, % Font
}
)'
Progress := v1_func('MakeProgress')
Progress , "Imaginative subtext", "Loading example ..."
@Lexikos
Lexikos / WarnLegacy.ahk
Created June 26, 2021 03:10
WarnLegacy() - prints a warning to sdout for each legacy assignment/IF.
/*
WarnLegacy(filename := A_ScriptFullPath)
Prints a warning to stdout for each detected use of the following:
var = value ; legacy assignment
if var = value ; legacy IF with any of these operators: = < > <= >= <> !=
excluding:
if var = n ; where n is any literal number, and = is any of the above operators.
Also handles #Include or #IncludeAgain if passed a directory or filename, but does
@Lexikos
Lexikos / AutoComplete.lua
Last active March 28, 2023 19:55
Improved auto-complete for SciTE
-- AutoComplete v0.8 by Lexikos
--[[
Tested on SciTE4AutoHotkey 3.0.06.01; may also work on SciTE 3.1.0 or later.
To use this script with SciTE4AutoHotkey:
- Place this file in your SciTE user settings folder.
- Add the following to UserLuaScript.lua:
dofile(props['SciteUserHome'].."/AutoComplete.lua")
- Restart SciTE.
]]
@Lexikos
Lexikos / IPC.ahk
Created January 28, 2015 08:11
IPC library by majkinetor
/* Title: IPC
*Inter-process Communication*.
*/
/*
Function: Send
Send the message to another process (receiver).
Parameters:
PidOrName - Process name or ID
@Lexikos
Lexikos / convert.hta
Created January 23, 2015 08:45
HTA for converting the `toc` data in toc.js to pure JSON. Requires IE8+.
<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<script src="toc.js"></script>
<script>
var fso = new ActiveXObject("Scripting.FileSystemObject")
var f = fso.OpenTextFile("toc.json", 2, true)
f.Write(JSON.stringify(toc))
f.Close()
window.close()
</script>
@Lexikos
Lexikos / ClipboardHTMLtoBBCode.ahk
Created September 16, 2014 09:09
Converts HTML content on the Clipboard to BBCode for ahkscript.org
; Converts HTML content on the Clipboard to BBCode for ahkscript.org
; Requires AutoHotkey v1.1
; Produces best results when copying from Internet Explorer
if html := GetClipboardHTMLFragment()
Clipboard := ConvertHTMLFragmentToBBCode(html)
ConvertHTMLFragmentToBBCode(html)
{
repl := [[
@Lexikos
Lexikos / menu-search.ahk
Created March 7, 2013 11:58
Window Menu Search - tap the Alt key to search the active window's menus. http://www.autohotkey.com/board/topic/91067-/
SetBatchLines -1
OnMessage(0x100, "GuiKeyDown")
OnMessage(0x6, "GuiActivate")
return
Alt::
Gui +LastFoundExist
if WinActive()
goto GuiEscape
Gui Destroy
@Lexikos
Lexikos / autohotkey.css
Created July 17, 2012 11:31
Custom styles for AutoHotkey forum, by Lexikos
/* Custom styles for AutoHotkey forum, by Lexikos. Tested only on Firefox 13.
License (or whatever): http://creativecommons.org/publicdomain/zero/1.0/ */
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix("http://www.autohotkey.com/community/") {
/* Some of the styles in the next section could be moved here, but then I'd have to do more
testing on the various forms/pages. Most of my time is spent on viewtopic.php anyway. */