AutoHotKey scripts for SuperMemo

From Pleasurable Learning
Revision as of 13:05, 2 November 2021 by Guillem (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This article is being written incrementally. Please come back in the future to see updates. Once it is finished this warning will disappear

Here I will be compiling useful AutoHotKey scripts for SuperMemo along with my suggested key binding.

Base Code

You may want to bind all shortcuts specifically to run only on SuperMemo, so all others apps are unaffected. The following code is the base where you can add any other shortcut binding you want. In that manner, you will have all custom shortcuts fro SuperMemo in one single file.

; main script for restricting execution of custom shortcut bindings to SuperMemo.
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
CoordMode, Mouse, Screen
#SingleInstance, force

GroupAdd, SuperMemo, ahk_class TBrowser ; Browser
GroupAdd, SuperMemo, ahk_class TContents ; Content Window (Knowledge Tree)
GroupAdd, SuperMemo, ahk_class TElWind ; Element window
GroupAdd, SuperMemo, ahk_class TElDATAWind ; Element Data window
GroupAdd, SuperMemo, ahk_class TSMMain ; Toolbar

Highlight selected text Ctrl + H

SuperMemo does not offer a direct keyboard shortcut for highlighting. This script automates the process of highlighting via commander. Binding: Ctrl + H

; highlight selected text
   send, ^{Enter}
   send, highlighter font
   send, {Enter}

Show References Ctrl + Shift + Alt + R

SuperMemo does not offer a direct keyboard shortcut for showing the references. This is useful when you cannot see the element's references as you would need to scroll down. Binding: Ctrl + Shift + Alt + R

; peek references
send, ^{Enter}
send, r
send, {Down}
send, {Enter}