User:Ineuw/Windows AutoHotKey Scripts

Introduction
Last updated: — &#32;— Ineuw (talk) 19:17, 17 December 2019 (UTC)


 * Autohotkey.ahk is the main keyboard macros script file for proofreading Wikisource text in Windows OS. These macros work in Firefox, Chrome and Opera browsers, but not with Internet Explorer 11.


 * The scripts are in two files: Autohotkey.ahk is the main file, and the Proofread.ahk script is the second (sub) file called by the Autohotkey.ahk.


 * The installation generates a sample Autohotkey.ahk file in the My Documents folder. Both the file name and the folder are defaults, which means that on start Autohotkey.exe will look for the Autohotkey.ahk scrip in the my Documents folder without any redirection. The contents of sample Autohotkey.ahk file are to be replaced with the code below, but any drive, folder, and file name with the .ahk extension can be specified on the command line of the shortcut link as follows.

"C:\Program Files\AutoHotkey\AutoHotkey.exe" D:\AHKFunctionsLibrary\Autohotkey.ahk


 * It is recommended the a shortcut link is also placed in the Windows Startup folder.


 * Note that in the script, the working drive "D:\" and the "\AHKFunctionsLibrary" is both my working and library folder. These are my choices of location. Update these to your preferred location.


 * The software's limitation is that the U.S. keyboard layout definition is to be used and when editing, the scripts are to be pasted into a text editor which supports ANSI and PC encoding (i.e: Windows Notepad). This is not a limitation when working with text directly in browsers.


 * Most keyboard key combination can assigned to satisfy one's preference, with some exceptions of the keys assigned by Microsoft, for their Windows keyboard. These exceptions are noted in my keyboard assignments macro key assignment list.


 * The cripts can be reassigned to different keyboard key combinations, deleted, or neutralized by placing the semicolon at the beginning of the lines of code. This means every line of code beginning with the keyboard key assignment and including the "return" at the end of the code segment.


 * Some key combinations were omitted because they conflict with Windows, or are needed for more important tasks.


 * Ctrl+p for printer/printing is omitted.


 * Win+l locks out the user - in Vista and later Windows versions, (but not in XP).


 * After changes, the file is to be saved and then reloaded using either of the two following options:


 * The Ctrl+\ (Control and backslash) key combination which is assigned to reload the script or,


 * Using the right mouse button click on the system tray AutoHotkey icon and select from the context menu options "Reload This Script."


 * The script actions were thoroughly tested. The Proofread.ahk macro, in the section below is linked by the #include declaration of the first line of this file. It's location is to be edited according to one's personal preference.

Autohotkey macro key assignment list
Last updated:  —  &#32;— Ineuw (talk) 19:25, 17 December 2019 (UTC)

This lists the current keyboard key assignments. No uppercase characters used to activate macros.


 * alt+'                        italicise selected text
 * alt+.                        DO NOT USE, assigned to the 'eng-pr.ahk' text format script.
 * alt+=                        emdash
 * alt+0
 * alt+1                        insert template end braces }}
 * alt+2                         replacement for two or more emdashes
 * alt+3                         graphic curly braces
 * alt+4                         floating quotation mark
 * alt+5                        insert 15% page width, enclosed by two
 * alt+7
 * alt+8
 * alt+9
 * alt+a                        UNASSIGNED
 * alt+b                        bold selected text using wiki markup
 * alt+backspace                DO NOT USE
 * alt+c                        center selected text template
 * alt+d                        double height row surrounded by a newline
 * alt+del                      UNASSIGNED
 * alt+e                        inserts vertical bar for table cell row
 * alt+end                      insert  in header and  in the footer
 * alt+f                        image container
 * alt+f1                       strips space from the end of row
 * alt+f12                      DO NOT USE - ASSIGNED to italics.ahk
 * alt+f4                       UNASSIGNED
 * alt+f5                       UNASSIGNED
 * alt+g                        inserts a variable gap in text
 * alt+h                         for reduced font-size fractions
 * alt+i                        italicize selected text<`/i>
 * alt+j
 * alt+k                        |ptb.5   pad top and pad bottom .5 em
 * alt+l
 * alt+m                        `\<`/math>
 * alt+n
 * alt+o                        copy title from 1st line to the header with page number on the right
 * alt+p                        copy title from 1st line to the header with page number on the left
 * alt+pgdn                     format subscript in $$$$
 * alt+pgup                     format superscript in $$$$
 * alt+q                        USED by TextPad
 * alt+r                        create reference tags and move cursor between the
 * alt+s                        small case selected text
 * alt+shift+0                  with serif font code
 * alt+shift+1                  UNASSIGNED
 * alt+shift+2                  UNASSIGNED
 * alt+shift+3                  UNASSIGNED
 * alt+shift+4                  UNASSIGNED
 * alt+shift+5                  chr(0146) ’ minutes
 * alt+shift+6                  chr(148) ” seconds
 * alt+shift+7                  insert 50% page width double rule, enclosed by two
 * alt+shift+9                  title case selected text
 * alt+shift+a                  chr(0225) á
 * alt+shift+b                  inserts |pb.5 pad bottom .5em table style code}}
 * alt+shift+c                  chr(0231) ç
 * alt+shift+e                  chr(0233) é
 * alt+shift+i                  chr(0237) í
 * alt+shift+l                  inserts |pl.5
 * alt+shift+m                  UNASSIGNED
 * alt+shift+n                  chr(0241) ñ
 * alt+shift+o                  chr(0243) ó
 * alt+shift+p                  PREVIEW KEY IN WIKIMEDIA SOFTWARE
 * alt+shift+r                  inserts |pr.5
 * alt+shift+s                  SAVE KEY of Wikimedia SOFTWARE in Firefox
 * alt+shift+t                  inserts |pt.5
 * alt+shift+u                  chr(0250) ú
 * alt+t                        created | for table style code input
 * alt+u                        UNASSIGNED
 * alt+v                        rop initial at the beginning of the line
 * alt+w                        width = table style code
 * alt+x:                       save wikisource edit in firefox
 * alt+y                        character spacing
 * alt+z                        add an empty row between two rows
 * ctrl+\                       reload script
 * ctrl+a                       DO NOT USE - 'SELECT ALL' IN ALL OPERATING SYSTEMS
 * ctrl+alt+l                   lowercase selected text
 * ctrl+alt+p
 * ctrl+alt+t                   title case selected text
 * ctrl+alt+u                   uppercase selected text
 * ctrl+b


 * ctrl+c                       DO NOT USE - 'COPY' IN ALL OPERATING SYSTEMS
 * ctrl+k                        [sic]
 * ctrl+l                       lowercase selected text in Textpad
 * ctrl+m                       $$selected$$
 * ctrl+numpad1                 ALTERNATIVE TO THE 'End' KEY WHEN LAPTOP NUMPAD IS ON
 * ctrl+numpad7                 ALTERNATIVE TO THE 'Home' KEY WHEN LAPTOP NUMPAD IS ON
 * ctrl+p                       `n `n
 * ctrl+s                       DO NOT USE - 'SAVE' KEY IN ALL OPERATING SYSTEMS
 * ctrl+Shift+1                 UNASSIGNED
 * ctrl+Shift+2                 UNASSIGNED
 * ctrl+Shift+3                 UNASSIGNED
 * ctrl+shift+4                 inserts 4 spaces (instead of tab)
 * ctrl+Shift+5                 UNASSIGNED
 * ctrl+Shift+6                 UNASSIGNED
 * ctrl+shift+8                 selected text
 * ctrl+Shift+8                 UNASSIGNED
 * ctrl+shift+9                 selected text
 * ctrl+shift+i                 wiki link to wikionary or wikipedia
 * ctrl+shift+l                 colspan = (table style code)
 * ctrl+shift+n                 DO NOT USE - Irfanview switch to negative image key
 * ctrl+shift+p
 * ctrl+shift+r                 DO NOT USE - RESERVED BY FIREFOX
 * ctrl+shift+s                 DO NOT USE - RESERVED BY FIREFOX
 * ctrl+shift+t                 insert<>
 * ctrl+shift+v                 RESERVED BY WINDOWS
 * ctrl+shift+w                 rowspan = (table code)
 * ctrl+shift+y                 chr(0176) ° degree indicator
 * ctrl+v                       DO NOT USE - 'PASTE' KEY IN ALL OPERATING SYSTEMS
 * ctrl+x                       DO NOT USE - 'CUT SELECTED' KEY IN ALL OPERATING SYSTEMS
 * ctrl+z                       DO NOT USE - REVERT LAST ACTION IN ALL OPERATING SYSTEMS
 * shift+esc                    paragraph line height and font size templates combined
 * win+'                        edit to search for floating single or double quote
 * win+0                        selected
 * win+1                        
 * win+2                        {Left 3}
 * win+3                        
 * win+4                        UNASSIGNED
 * win+5                        UNASSIGNED
 * win+6                        UNASSIGNED
 * win+7
 * win+8                         without centering
 * win+9                         without centering
 * win+a                         at the left margin
 * win+b                        HTML bold selected text<`/b>
 * win+c                         center and italicize selected text
 * win+d                        block of text selected text<`/div>
 * win+down                     inserts {{hwe| at the beginning of a row
 * win+e                         any place in the text
 * win+f                        DO NOT USE RESERVED BY WINDOWS FOR FEEDBACK
 * win+g                        {{c|sc|selected text}}
 * win+h                        hanging indent
 * win+i                        {{SIC|selected text|selected text|}}
 * win+j                        {{float right|selected text|2em}}
 * win+k                        search and remove caret
 * win+l                        DO NOT USE, WINDOWS LOCK
 * win+m
 * win+n
 * win+numpad1                  ALTERNATIVE TO THE 'Shift+End' KEY WHEN LAPTOP NUMPAD IS ON
 * win+numpad7                  ALTERNATIVE TO THE 'Shift+Home' KEY WHEN LAPTOP NUMPAD IS ON
 * win+o                        {{cdm||}}
 * win+p                        
 * win+w                        for Wikisource images {{Do not move to Commons}}
 * win+x                        WINDOWS MENU WHEN WINDOWS SHORTCUTS ARE ENABLED. Disabled with UWTweaks
 * win+z                        z
 * mbutton                      switch to newly opened tab

Autohotkey.ahk

 * 2020-03-27 2:11 PM UTC-4


 * D:\ahk\eng.ahk


 * english desktop version, numpad navigation keys are disabled
 * english laptop version, numpad navigation keys are enabled

SetWorkingDir, D:\ahk


 * 1) include d:\ahk\eng_pr.ahk
 * 2) installkeybdhook
 * 3) noenv
 * 4) singleinstance force
 * 5) warn

SetTimer, AutoReload, 50000

~lwin::vk07 ~rwin::return ~appskey::return ~#bs::return


 * test keys =======================================================

return
 * ~'                          generate ''
 * clipboard := ""
 * sendinput, '
 * sendinput, '


 * alt =============================================================


 * alt+backspace                DO NOT USE

!f1:: clipboard := "" autotrim, on	send, ^a^c			      ; select everything on the page clipwait, 1 in_put := " `r`n"         ; space preceeding crlf out_put := "`r`n" clipboard := regexreplace(clipboard, in_put, out_put) clipwait, 1 send, ^v send, ^{Home} return
 * alt+f1                       strips space from the end of row

clipboard := "" return
 * alt+f4                       UNASSIGNED
 * !f4::

!f5:: clipboard := "" return
 * alt+f5                       UNASSIGNED


 * alt+f12                      DO NOT USE - ASSIGNED to italics.ahk

!pgup:: autotrim, on	clipboard := "" sendinput, ^c clipwait, 1 selected= trim(clipboard) sendinput, {asc 0094} sendinput, %clipboard% return
 * alt+pgup                     format superscript in $$$$

!pgdn:: autotrim, on	clipboard := "" sendinput, ^c clipwait, 1 selected= trim(clipboard) sendinput, {asc 0095} sendinput, %clipboard% return
 * alt+pgdn                     format subscript in $$$$


 * alt+del                      UNASSIGNED

!end:: clipboard := "" sendinput, {text} clipwait, 0 sendinput, {tab 2} sendinput, {text}`n sendinput, +{tab} sendinput, ^{home} return
 * alt+end                      insert  in header and  in the footer

!'::	autotrim, off clipboard := "" sendinput, ^c clipwait, 1 if (substr(clipboard, 0) = A_space) {	selected= trim(clipboard) clipboard= %clipboard%%A_space% }	Else {	selected= trim(%clipboard%) clipboard= %clipboard% }	sendinput, ^v return
 * alt+'                        italicise selected text


 * alt+.                        DO NOT USE, assigned to the 'eng-pr.ahk' text format script.

!=::	clipboard := "" sendinput, %A_Space%{u+2014}%A_Space% return
 * alt+=                        emdash

!0::	autotrim, off clipboard := "" sendinput, {home}+{end} sendinput, ^c clipwait, 1 selected := clipboard if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard = %A_space% }	else {	selected := trim(selected) clipboard = }	sendinput, ^v sendinput, {Home} sendinput, {right 5} return
 * alt+0

!1::	clipboard := "" sendinput, {text}}} return
 * alt+1                        insert template end braces }}

!2::	clipboard := "" sendinput, {text} return
 * alt+2                         replacement for two or more emdashes

!3::	clipboard := "" sendinput, {text} sendinput, {left 3} return
 * alt+3                         graphic curly braces

!4::	clipboard := "" sendinput, {text} return
 * alt+4                         floating quotation mark

!5::	clipboard := "" sendinput, {home} sendinput, {text}`n sendinput, {text} sendinput, {text}`n`n sendinput, {raw} sendinput, {text}`n`n sendinput, {text} sendinput, {text}`n return
 * alt+5                        insert 15% page width, enclosed by two

!7::	selected = clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard := "" sendinput, ^v return
 * alt+7

!8::	clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard := "" sendinput, ^v return
 * alt+8

!9::	clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard := "" sendinput, ^v return
 * alt+9

clipboard := "" return
 * alt+a                        UNASSIGNED
 * !a::

!b:: clipboard := "" selected := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard := %selected% sendinput, ^v return
 * alt+b                        bold selected text using wiki markup

!c:: clipboard := "" selected := "" sendinput, ^x clipwait, 1 selected := trim(clipboard) clipboard := "" sendinput, ^v return
 * alt+c                        center selected text template

!d:: clipboard := "" sendinput, {Home}`n sendinput, {text}`n return
 * alt+d                        double height row surrounded by a newline

!e:: sendinput, {Home}|{Down} return
 * alt+e                        inserts vertical bar for table cell row

!f:: clipboard := "" autotrim, off sendinput, {home}`n{home} return
 * alt+f                        image container

!g:: clipboard := "" sendinput, {text} return
 * alt+g                        inserts a variable gap in text

!h:: clipboard := "" sendinput, {text} sendinput, {left 6} return
 * alt+h                         for reduced font-size fractions

!i:: clipboard := "" autotrim, off sendinput, ^c clipwait, 1 selected := clipboard if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= %selected%<`/i>%A_space% }	Else {	selected := trim(selected) clipboard= %selected%<`/i> }	sendinput, ^v return
 * alt+i                        italicize selected text<`/i>

!j:: clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard := "". %selected%. ""	sendinput, ^v return
 * alt+j

!k:: clipboard := "" sendinput, |ptb.5{left 6}{down} return
 * alt+k                        |ptb.5   pad top and pad bottom .5 em

!l:: clipboard := "" sendinput, ^c clipwait, 1 clipboard := trim(clipboard) clipboard= `{`{Plr|%clipboard%`}`} sendinput, ^v return
 * alt+l

!m:: clipboard := "" sendinput, {text}`\<`/math> sendinput, {left 7} return
 * alt+m                        `\<`/math>

!n:: clipboard := "" ;sendinput, `n sendinput, {text}`n return
 * alt+n
 * sendinput, {text}`n|-`n|}`n`n

!o:: clipboard := "" sendinput, ^x clipwait, 0 clipboard := trim(clipboard) sendinput, +{tab} sendinput, ^{home} sendinput, +{end}{del} sendinput, {text}Rh sendinput, {end} sendinput, {left 2} return
 * alt+o                        copy title from 1st line to the header with page number on the right

!p:: clipboard := "" sendinput, ^x clipwait, 0 clipboard := trim(clipboard) sendinput, +{tab} sendinput, ^{home} sendinput, +{end}{del} sendinput, {text}Rh sendinput, {home} sendinput, {right 5} return
 * alt+p                        copy title from 1st line to the header with page number on the left


 * alt+q                        USED by TextPad

!r:: autotrim, off clipboard := "" sendinput, ^c clipwait, 1 if (substr(clipboard, 0) = A_space) {	clipboard := trim(clipboard) clipboard= %A_space% }	Else {	selected := trim(clipboard) clipboard= }	sendinput, ^v return
 * alt+r                        create reference tags and move cursor between the

!s:: clipboard := "" autotrim, off sendinput, ^c clipwait, 0 selected := clipboard if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= %A_space% }	else {	selected := trim(selected) clipboard= }	sendinput, ^v return
 * alt+s                        small case selected text

!t:: clipboard := "" sendinput, {text}| sendinput, {left 3} return
 * alt+t                        created | for table style code input


 * alt+u                        UNASSIGNED

!v:: clipboard := "" sendinput, {Home} sendinput, {text} return
 * alt+v                        rop initial at the beginning of the line

!w:: clipboard := "" sendinput, {text}width = %A_Space% return
 * alt+w                        width = table style code

!x:: clipboard := "" sendinput, !+s return
 * alt+x:                       save wikisource edit in firefox

!y:: clipboard := "" autotrim, off sendinput, ^c clipwait, 1 selected := clipboard if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= %A_space% }	else {	selected := trim(selected) clipboard= }	sendinput, ^v return
 * alt+y                        character spacing

!z:: clipboard := "" send, {home} send, {home}`n send, {down} return
 * alt+z                        add an empty row between two rows


 * alt+shift =======================================================

!+0::	clipboard := "" selected = begin_div = end_div = sendinput, ^c clipwait, 0 selected := trim(clipboard) begin_div = `n end_div = `n `n clipboard := %begin_div%%selected%%end_div% sendinput, ^v return
 * alt+shift+0                  with serif font code


 * alt+shift+1                  UNASSIGNED


 * alt+shift+2                  UNASSIGNED


 * alt+shift+3                  UNASSIGNED


 * alt+shift+4                  UNASSIGNED

!+5::	clipboard := "" send, {text}’ return
 * alt+shift+5                  chr(0146) ’ minutes

!+6::	clipboard := "" send, {text}” return
 * alt+shift+6                  chr(148) ” seconds

!+7::	clipboard := "" sendinput, {home} sendinput, {text}`n sendinput, {text} sendinput, {text}`n`n sendinput, {raw} sendinput, {text}`n`n sendinput, {text} sendinput, {text}`n return
 * alt+shift+7                  insert 50% page width double rule, enclosed by two

+8::	clipboard := "" sendinput, {text}`n`n return

!+9::	clipboard := "" sendinput, ^c clipwait, 0 stringlower, clipboard, clipboard, t	sendinput, ^v return
 * alt+shift+9                  title case selected text

!+a:: clipboard := "" sendinput, á return
 * alt+shift+a                  chr(0225) á

!+b:: clipboard := "" sendinput, |pb.5{left 5}{down} return
 * alt+shift+b                  inserts |pb.5 pad bottom .5em table style code}}

!+c:: clipboard := "" sendinput, ç return
 * alt+shift+c                  chr(0231) ç

!+e:: clipboard := "" sendinput, é return
 * alt+shift+e                  chr(0233) é

!+i:: clipboard := "" sendinput, í return
 * alt+shift+i                  chr(0237) í

!+l:: clipboard := "" sendinput, `|pl.5{left 5}{down} return
 * alt+shift+l                  inserts |pl.5


 * alt+shift+m                  UNASSIGNED

!+n:: clipboard := "" sendinput, ñ return
 * alt+shift+n                  chr(0241) ñ

!+o:: clipboard := "" sendinput, ó return
 * alt+shift+o                  chr(0243) ó


 * alt+shift+p                  PREVIEW KEY IN WIKIMEDIA SOFTWARE

!+r:: clipboard := "" sendinput, `|pr.5{left 5}{down} return
 * alt+shift+r                  inserts |pr.5


 * alt+shift+s                  SAVE KEY of Wikimedia SOFTWARE in Firefox

!+t:: clipboard := "" sendinput, |pt.5{left 5}{down} return
 * alt+shift+t                  inserts |pt.5

!+u:: clipboard := "" sendinput, ú return
 * alt+shift+u                  chr(0250) ú


 * ctrl ============================================================

return
 * ctrl+numpad1                 ALTERNATIVE TO THE 'End' KEY WHEN LAPTOP NUMPAD IS ON
 * ^Numpad1::
 * sendinput, {End}

return
 * ctrl+numpad7                 ALTERNATIVE TO THE 'Home' KEY WHEN LAPTOP NUMPAD IS ON
 * ^Numpad7::
 * sendinput, {Home}

^\::	clipboard := "" reload return
 * ctrl+\                       reload script


 * ctrl+a                       DO NOT USE - 'SELECT ALL' IN ALL OPERATING SYSTEMS


 * ctrl+b

^b:: clipboard := "" sendinput,  return


 * ctrl+c                       DO NOT USE - 'COPY' IN ALL OPERATING SYSTEMS

^k:: clipboard := "" sendinput, {text} [sic] return
 * ctrl+k                        [sic]


 * ctrl+l                       lowercase selected text in Textpad

^m:: clipboard := "" selected := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= {text}%selected%<`/math>%A_space% }	else {	selected := trim(selected) clipboard= {text}%selected%<`/math> }	sendinput, ^v return
 * ctrl+m                       $$selected$$

^p:: clipboard := "" sendinput, `n `n return
 * ctrl+p                       `n `n


 * ctrl+s                       DO NOT USE - 'SAVE' KEY IN ALL OPERATING SYSTEMS


 * ctrl+v                       DO NOT USE - 'PASTE' KEY IN ALL OPERATING SYSTEMS


 * ctrl+x                       DO NOT USE - 'CUT SELECTED' KEY IN ALL OPERATING SYSTEMS


 * ctrl+z                       DO NOT USE - REVERT LAST ACTION IN ALL OPERATING SYSTEMS


 * ctrl+alt =======================================================

^!l:: clipboard := "" selected := "" replaced := "" sendinput, ^c clipwait, 1 selected := clipboard stringlower, replaced, selected sendinput, %replaced% sendinput, {Home} return
 * ctrl+alt+l                   lowercase selected text

^!p:: clipboard := "" sendinput, {text} sendinput {left 2} return
 * ctrl+alt+p

^!t:: clipboard := "" selected := "" replaced := "" sendinput, ^c clipwait, 1 selected := clipboard stringlower, replaced, selected, T	sendinput, %replaced% sendinput, {Home} return
 * ctrl+alt+t                   title case selected text

^!u:: clipboard := "" selected := "" replaced := "" sendinput, ^c clipwait, 1 selected := clipboard stringupper, replaced, selected sendinput, %replaced% sendinput, {Home} return
 * ctrl+alt+u                   uppercase selected text


 * ctrl+shift =====================================================


 * ctrl+Shift+1                 UNASSIGNED


 * ctrl+Shift+2                 UNASSIGNED


 * ctrl+Shift+3                 UNASSIGNED

^+4::	clipboard := "" sendinput, %A_space%%A_space%%A_space%%A_space% return
 * ctrl+shift+4                 inserts 4 spaces (instead of tab)


 * ctrl+Shift+5                 UNASSIGNED


 * ctrl+Shift+6                 UNASSIGNED


 * ctrl+Shift+8                 UNASSIGNED

^+8::	clipboard := "" sendinput, ^c clipwait, 1 clipboard= {text}%clipboard% sendinput, ^v return
 * ctrl+shift+8                 selected text

^+9::	clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard= %selected% sendinput, ^v return
 * ctrl+shift+9                 selected text

^+i:: clipboard := "" autotrim, off sendinput, ^c clipwait, 1 selected := clipboard if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= `[`[wikt:%selected%|%selected%`]`]%A_space% }	Else {	selected := trim(selected) clipboard= `[`[wikt:%selected%|%selected%`]`] }	sendinput, ^v return
 * ctrl+shift+i                 wiki link to ionary or ikipedia, selected text

^+l:: clipboard := "" sendinput, {text}colspan = %a_space% sendinput, {left 1} return
 * ctrl+shift+l                 colspan = (table style code)


 * ctrl+shift+n                 DO NOT USE - Irfanview switch to negative image key

^+p::
 * ctrl+shift+p

clipboard := "" sendinput, {text}

return


 * ctrl+shift+r                 DO NOT USE - RESERVED BY FIREFOX


 * ctrl+shift+s                 DO NOT USE - RESERVED BY FIREFOX

^+t:: clipboard := "" sendinput, {text}<> sendinput, {left 3} return
 * ctrl+shift+t                 insert<></>


 * ctrl+shift+v                 RESERVED BY WINDOWS

^+w:: clipboard := "" sendinput, {text}rowspan = %a_space% sendinput, {left 1} return
 * ctrl+shift+w                 rowspan = (table code)

^+y:: clipboard := "" sendinput, {text}° return
 * ctrl+shift+y                 chr(0176) ° degree indicator


 * shift ======================================================= = = =

+esc:: autotrim, on	clipboard := "" sendinput, ^c clipwait, 0 selected := trim(clipboard) clipboard= sendinput, ^v return
 * shift+esc                    paragraph line height and font size templates combined


 * win ============================================================

return
 * win+numpad1                  ALTERNATIVE TO THE 'Shift+End' KEY WHEN LAPTOP NUMPAD IS ON
 * Numpad1::
 * sendinput, +{end}

return
 * win+numpad7                  ALTERNATIVE TO THE 'Shift+Home' KEY WHEN LAPTOP NUMPAD IS ON
 * Numpad7::
 * sendinput, +{home}

clipboard := "" sendinput, ^f clipwait, 0 sendinput, '' clipwait, 0 sendinput, {esc} {left 1} ; Firefox return
 * win+'                        edit to search for floating single or double quote
 * sendinput, {esc}          ; Vivaldi

sendinput, {Home} sendinput, {text}{{hwe| sendinput, ^{right}{backspace} sendinput, {text}|x}}%A_space% sendinput, {left 4} return
 * win+down                     inserts {{hwe| at the beginning of a row
 * 1) down::

sendinput, {backspace}^{left} sendinput, {text}{{hws| sendinput, {end} sendinput, {text}|x}} sendinput, {left 3} return
 * win+up                       encloses hyphenated text start with {{hws| - place at the end of line and activate
 * up::

autotrim, off selected = pasted = clipboard := "" sendinput, ^c clipwait, 1 selected := clipboard if (substr(selected, 0) = %A_space%) {	selected := trim(selected) stringlower, pasted, selected clipboard := %pasted%%A_space% } else {	selected := trim(selected) stringLower, pasted, selected clipboard := %pasted% }	sendinput, ^v return

sendinput, ^{Home}<section begin = E `/>{Left 3} return
 * win+1                        <section end = E `/>
 * 1::

sendinput, `n<section end = E `/>`n<section begin = B `/>{Left 3} return
 * win+2                        <section end = E `/><section begin = B `/>{Left 3}
 * 2::

sendinput, ^{end}<section end = B `/>{Left 3} return
 * win+3                        <section end = B `/>
 * 3::


 * win+4                        UNASSIGNED


 * win+5                        UNASSIGNED


 * win+6                        UNASSIGNED

clipboard := "" sendinput, {text}removed existing return
 * win+7                        {{under construction}}  {{removed existing}}
 * 7::

autotrim, off clipboard := "" sendinput, ^c clipwait, 1 selected := clipboard if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= {{fs85|%selected%}}%A_space% }	else {	selected := trim(selected) clipboard= {{fs85|%selected%}} }	sendinput, ^v return
 * win+8                        {{fs85|selected text}} without centering
 * 8::

autotrim, off clipboard := "" sendinput, ^c clipwait, 1 selected := clipboard if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= {{fs90|%selected%}}%A_space% }	else {	selected := trim(selected) clipboard= {{fs90|%selected%}} }	sendinput, ^v return
 * win+9                        {{fs90|selected text}} without centering
 * 9::

clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard= %selected%<`/div> sendinput, ^v return
 * win+0                        selected
 * 0::

sendinput, {Home} sendinput, {text}{{anchor|D}} sendinput, {left 2} return
 * win+a                        {{anchor|D}} at the left margin
 * a::

autotrim, off clipboard := "" sendinput, ^c clipwait, 1 selected := clipboard if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= <b>%selected%<`/b>%A_space% }	else {	selected := trim(selected) clipboard= <b>%selected%<`/b> }	sendinput, ^v return
 * win+b                        HTML bold <b>selected text<`/b>
 * b::

autotrim, off clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= {{c|%selected%}}%A_space% }	else {	selected := trim(selected) clipboard= {{c|%selected%}} }	sendinput, ^v return
 * win+c                        {{c|selected text}} center and italicize selected text
 * c::

clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard := "<div {{ts|width:500px;|mc|aj|sm90|lh12|pb.5}}>`n%selected%`n<`/div>" sendinput, ^v return
 * win+d                        block of text <div {{ts|width:500px;|mc|ac|sm85|lh11|pb.5}}>selected text<`/div>
 * d::

sendinput, {text}{{anchor|D}} sendinput, {left 2} return
 * win+e                        {{anchor|D}} any place in the text
 * e::


 * win+f                        DO NOT USE RESERVED BY WINDOWS FOR FEEDBACK

autotrim, off clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard= {{c|}} sendinput, ^v return
 * win+g                        {{c|sc|selected text}}
 * g::

clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard= {{hi|%selected%}} sendinput, ^v return
 * win+h                        hanging indent
 * h::

autotrim, off clipboard := "" sendinput, ^c clipwait, 1 selected := clipboard if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= {{SIC|%selected%|%selected%}}%A_space% }	Else {	selected := trim(selected) clipboard= {{SIC|%selected%|%selected%}} }	sendinput, ^v return
 * win+i                        {{SIC|selected text|selected text|}}
 * i::

clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard= {{right|%selected%|2em}} sendinput, ^v return
 * win+j                        {{float right|selected text|2em}}
 * j::

critical, on	clipboard := "" newtext := "" sendinput, ^a^c newtext := clipboard newtext := strreplace(newtext, "^") sleep, 500 clipboard := newtext sendinput, ^v critical, off return
 * win+k                        search and remove caret
 * k::


 * win+l                        DO NOT USE, WINDOWS LOCK

clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard= sendinput, ^v return
 * win+m
 * m::

clipboard := "" sendinput, {text} return
 * win+n
 * n::

clipboard := "" sendinput, {text}{{cdm||304}} sendinput, {left 6}q return
 * win+o                        {{cdm||}}
 * o::

clipboard := "" sendinput, ^c clipwait, 1 selected := trim(clipboard) clipboard= <poem style = "display: table; font-size: 90`%; line-height: 120`%; margin-left: auto; margin-right: auto; width: auto;">`n%selected%`n<`/poem> sendinput, ^v return
 * win+p                        <poem style = ""
 * p::

clipboard := "" autotrim, off clipboard := "" sendinput, ^c clipwait, 1 selected := clipboard if (substr(selected, 0) = A_space) {	selected := trim(selected) clipboard= {{sm|%selected%}}%A_space% }	else {	selected := trim(selected) clipboard= {{sm|%selected%}} }	sendinput, ^v return
 * win+q                        {{sm|selected text}}
 * q::

clipboard := "" sendinput, {text} sendinput, {left 6} return
 * win+r
 * r::

clipboard := "" sendinput, ^a{Del}^{Home} sendinput, {text}{{rule}} sendinput, `n			; without rule sendinput, {text}{{smallrefs}} sendinput, `n return
 * win+s                        insert in footer {{rule}}\n{{smallrefs}}
 * s::
 * sendinput, `n`n			; with rule

clipboard := "" sendinput, {text}{| {{ts|mc|sm95|lh13|aj|bc|bgt}}`n|-		; border return
 * win+t                        table and style definition {| {{ts|bt|bb|mc|sm85|lh11|ar|bc|bgt}}
 * t::

clipboard := "" sendinput, ^c clipwait, 0 selected := trim(clipboard) clipboard= %selected%<`/sup> sendinput, ^v sendinput, {left 6} return
 * win+u                        superscript selected text
 * u::

clipboard := "" sendinput, ^c clipwait, 0 selected := trim(clipboard) clipboard= %selected%<`/sub> sendinput, ^v return
 * win+v                        subscript selected text<`/sub>
 * v::

clipboard := "" sendinput, {text}{{Do not move to Commons}} return
 * win+w                        for Wikisource images {{Do not move to Commons}}
 * w::


 * win+x                        WINDOWS MENU WHEN WINDOWS SHORTCUTS ARE ENABLED. Disabled through Ultimate Windows Tweaks - Disable Winkey shortcuts

sendinput, {text} return
 * win+z                        z
 * z::


 * mouse ===========================================================

detecthiddentext, on mbutton::send, {lshift down}{lbutton}{lshift up} detecthiddentext, off return
 * mbutton                      switch to newly opened tab
 * 1) ifwinactive ahk_exe vivaldi.exe
 * 1) ifwinactive

return

AutoReload:

Reload

Return



Proofread.ahk
Last update: —  — Ineuw talk 22:39, 4 August 2016 (UTC)


 * The proofread script is assigned to the combination of he Alt + . keys, but any keyboard key, combinations of keys, or word typed on the keyboard, can be assigned to the user's preference.


 * This macro is in a separate file but linked to the Autohotkey.ahk by the #include declaration in the Autohotkey.ahk.

!.::
 * Alt+. proofread

clipboard:=

autotrim, on

send, ^a^c

clipwait, 0 	;0 = slows clipboard action with a .5 second delay

in_put:=A_Space. A_Space out_put:=A_Space clipboard:=strreplace(clipboard, in_put, out_put)
 * reduce two spaces to one

clipwait, 0

in_put:=" ," out_put:="," clipboard:=strreplace(clipboard, in_put, out_put)
 * remove space preceeding a comma

clipwait, 0

in_put:=" ." out_put:="." clipboard:=strreplace(clipboard, in_put, out_put)
 * remove space preceeding a period

clipwait, 0

in_put:=" \;" out_put:=";" clipboard:=regexreplace(clipboard, in_put, out_put)
 * remove space preceeding a semicolon

clipwait, 0

in_put:=" :" out_put:=":" clipboard:=strreplace(clipboard, in_put, out_put)
 * space preceeding a colon

clipwait, 0

in_put:=" \?" out_put:="?" clipboard:=regexreplace(clipboard, in_put, out_put)
 * remove space preceeding a question mark

clipwait, 0

in_put:=" !" out_put:="!" clipboard:=strreplace(clipboard, in_put, out_put)
 * remove space preceeding an exclamation mark

clipwait, 0

in_put:="( " out_put:="(" clipboard:=strreplace(clipboard, in_put, out_put)
 * remove space following an open bracket

clipwait, 0

in_put:=" )" out_put:=")" clipboard:=strreplace(clipboard, in_put, out_put)
 * remove space preceeding a close bracket

clipwait, 0

in_put:=" -" out_put:="-" clipboard:=strreplace(clipboard, in_put, out_put)
 * remove space preceeding a hyphen

clipwait, 0

in_put:="- " out_put:="-" clipboard:=strreplace(clipboard, in_put, out_put)
 * space following a hyphen

clipwait, 0

in_put:="`^" out_put:="" clipboard:=strreplace(clipboard, in_put, out_put)
 * remove the caret

clipwait, 0

in_put:="modem" out_put:="modern" clipboard:=strreplace(clipboard, in_put, out_put)
 * the word 'modem' to 'modern'

clipwait, 0

in_put:=" `r`n" out_put:="`r`n" clipboard:=regexreplace(clipboard, in_put, out_put)
 * space preceeding a crlf

clipwait, 0

in_put:="`r`n " out_put:="`r`n" clipboard:=regexreplace(clipboard, in_put, out_put)
 * space following a crlf

clipwait, 0

in_put:="`r`n`r`n`r`n" out_put:="`r`n`r`n" clipboard:=regexreplace(clipboard, in_put, out_put)
 * change three crlfs to two crlf

clipwait, 0

in_put:="`r`n`r`n" out_put:="" clipboard:=regexreplace(clipboard, in_put, out_put)
 * two crlfs to

clipwait, 0

in_put:="-`r`n" out_put:="" clipboard:=regexreplace(clipboard, in_put, out_put)
 * hyphen preceeding a crlf

clipwait, 0

in_put:="`r`n" out_put:=" " clipboard:=regexreplace(clipboard, in_put, out_put)
 * single crlf with space

clipwait, 0

in_put:=chr(0x20)chr(0x2014) out_put:=chr(0x2014) clipboard:=regexreplace(clipboard, in_put, out_put)
 * space and mdash

clipwait, 0

in_put:=chr(0x2014)chr(0x20) out_put:=chr(0x2014) clipboard:=regexreplace(clipboard, in_put, out_put)
 * mdash and space

clipwait, 0

in_put:="" out_put:="`r`n`r`n" clipboard:=regexreplace(clipboard, in_put, out_put)
 * two tildes restore paragraph breaks

clipwait, 0

clipboard:=regexreplace(clipboard, "\.(?=\.)", ". ") send, ^v^{Home}
 * two periods side by side

sleep, 500

clipclear:=

sleep, 100 send, ^{Home} send, ^f send, ^a send, {Del} sleep, 100 send, "{esc}{right}+{left} return