Difference between revisions of "AutoHotKey scripts for SuperMemo"

From Pleasurable Learning
Jump to navigation Jump to search
m
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
Here I will be compiling useful AutoHotKey scripts for SuperMemo:
{{IncrementalWarning}}


==Highlight selected text [ctrl+H]==
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.
 
<pre>
; 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
SetTitleMatchMode,2
 
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
</pre>
 
 
==Highlight selected text {{kbd|Ctrl + H}}==
[[SuperMemo]] does not offer a direct keyboard shortcut for highlighting. This script automates the process of highlighting via commander.
[[SuperMemo]] does not offer a direct keyboard shortcut for highlighting. This script automates the process of highlighting via commander.
 
Binding: <kbd>Ctrl</kbd> + <kbd>H</kbd>
<pre>
<pre>
; highlight selected text
; highlight selected text
Line 12: Line 35:
   send, {Enter}
   send, {Enter}
}
}
Return
</pre>
==Show References {{kbd|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: <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>R</kbd>
<pre>
; peek references
^+!r::
{
send, ^{Enter}
send, r
send, {Down}
send, {Enter}
}
Return
</pre>
</pre>

Latest revision as of 13:05, 2 November 2021

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
SetTitleMatchMode,2

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
^H::
{
   send, ^{Enter}
   send, highlighter font
   send, {Enter}
}
Return

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
^+!r::
{
send, ^{Enter}
send, r
send, {Down}
send, {Enter}
}
Return