User:Ineuw/AutoHotKey

From Wikisource
Jump to: navigation, search

Introduction[edit]

Last updated: — Ineuw talk 02:13, 18 July 2015 (UTC)

  • Autohotkey.ahk 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 file linked into 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 is 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 program 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[edit]

Last updated: — Ineuw talk 05:04, 15 January 2017 (UTC)

This lists the current keyboard key assignments. No uppercase characters used. Key combinations with numerals refer to the keys above the characters and not the Number Pad keys.

;alt-'                        italicise ''selected text'' 
;alt-.                        DO NOT USE, assigned to the 'proofread.ahk' file.
;alt-0                        <div {{ts|ptb.5|lh12}}>%selected%{{Div end}}
;alt-1                        }}
;alt-2                        {{fqm}} floating quotation mark
;alt-3                        {{bar|2}}
;alt-4                        \n{{Dhr}}\n{{rule|4em}}\n{{Dhr}}\n
;alt-5                        \n{{Dhr}}\n{{rule|65%}}{{rule|65%}}\n{{Dhr}}\n
;alt-6                        {{Dhr|2.5em}}\n{{rule|12em}}
;alt-7                        {{c|{{fs75|selected text}}}}
;alt-8                        {{c|{{fs85|selected text}}}}
;alt-9                        {{c|{{fs90|selected text}}}}
;alt-=                        remove braces from mdash —
;alt-a                        UNASSIGNED
;alt-b                        bold '''selected text'''
;alt-c                        {{center|selected text}}
;alt-d                        \n{{Dhr}}\n
;alt-del                      inserts "| cstyle  = margin-top:16px; margin-bottom:-0px" missing from image containes
;alt-e                        inserts | vertical bar at the beginning of the row for table row
;alt-f                        FIS image container
;alt-g                        {{gap}}
;alt-h                        {{fs75|{{sfrac||}}}} for reduced fon-size fractions
;alt-i                        italicize <i>selected text</i> 
;alt-ins                      {{under construction}}
;alt-j                        {{left|selected text|2em}}
;alt-k                        |ptb.5  {{ts|table style code}} pad top and pad bottom .5 em
;alt-l                        {{Plr|selected text}} 
;alt-m                        inserts emdash —
;alt-n                        {{nop}}
;alt-o                        copy title from 1st line of the text body into the correct segment of the running header template 
;alt-p                        {{rh||''THE POPULAR SCIENCE MONTHLY.''|}}
;alt-q                        DO NOT USE - RESERVED FOR TEXTPAD
;alt-r                        create open and close reference tag and move cursor between the two <ref></ref>
;alt-s                        small case {{sc|selected text}}
;alt-shift-0                  UNASSIGNED
;alt-shift-a                  {{color|red|''Arabic missing''}}
;alt-shift-b                  UNASSIGNED
;alt-shift-c                  UNASSIGNED
;alt-shift-d                  <div style="text-align:center; font-family:serif serif; font-style:normal; font-weight:500;"{{Div end}}
;alt-shift-e                  UNASSIGNED
;alt-shift-f                  UNASSIGNED
;alt-shift-g                  {{color|red|''Greek missing''}}
;alt-shift-h                  {{he|}} hebrew RTL
;alt-shift-i                  types 'Cleaned image and improved contrast'
;alt-shift-j                  UNASSIGNED
;alt-shift-k                  UNASSIGNED
;alt-shift-l                  DO NOT USE - LOCKS SCREEN IN WINDOWS
;alt-shift-m                  UNASSIGNED
;alt-shift-n                  UNASSIGNED
;alt-shift-o                  UNASSIGNED
;alt-shift-p                  DO NOT USE - Preview key in Wikipedia software
;alt-shift-q                  UNASSIGNED
;alt-shift-r                  UNASSIGNED
;alt-shift-s                  DO NOT USE - Save key in Wikipedia
;alt-shift-t                  UNASSIGNED
;alt-shift-u                  UNASSIGNED
;alt-shift-v                  UNASSIGNED
;alt-shift-w                  inserts template {{PSM link|Title|Volume|Month&Year|author=}}
;alt-shift-x                  UNASSIGNED
;alt-shift-y                  UNASSIGNED
;alt-shift-z                  UNASSIGNED
;alt-t                        created {{ts|}}| for table style code input
;alt-u                        UNASSIGNED
;alt-v                        {{di|D}}rop initial at the beginning of the line
;alt-w                        width= table style code
;alt-x                        UNASSIGNED
;alt-y                        {Asc 0183} · center dot used as decimal point until 1880s
;alt-z                        remove unicode null characters in scanned text
;ctrl-\                       re-load this edited and saved .ahk file
;ctrl-a                       DO NOT USE - SELECT ALL in all Operating systems
;ctrl-b                       UNASSIGNED
;ctrl-c                       DO NOT USE - COPY selected in all Operating systems
;ctrl-d                       UNASSIGNED
;ctrl-e                       UNASSIGNED
;ctrl-f                       UNASSIGNED
;ctrl-g                       UNASSIGNED
;ctrl-h                       UNASSIGNED
;ctrl-i                       UNASSIGNED
;ctrl-j                       UNASSIGNED
;ctrl-k                       {{sic}}
;ctrl-l                       UNASSIGNED
;ctrl-m                       <math>selected</math>
;ctrl-n                       UNASSIGNED
;ctrl-o                       UNASSIGNED
;ctrl-p                       \n<p>\n
;ctrl-q                       UNASSIGNED
;ctrl-r                       UNASSIGNED
;ctrl-s                       DO NOT USE - SAVE KEY IN ALL OPERATING SYSTEMS
;ctrl-shift-0                 UNASSIGNED
;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-7                 UNASSIGNED
;ctrl-shift-8                 {{fs85/s}}selected text{{fs85/e}}
;ctrl-shift-9                 {{fs90/s}}selected text{{fs90/e}}
;ctrl-shift-a                 UNASSIGNED
;ctrl-shift-b                 inserts |pb.5 {{ts|pad bottom .5em table style code}}
;ctrl-shift-c                 {{colors|black|LightSalmon|selected text}}
;ctrl-shift-d                 UNASSIGNED
;ctrl-shift-e                 UNASSIGNED
;ctrl-shift-f                  font size {{fs||selected}}
;ctrl-shift-g                 UNASSIGNED
;ctrl-shift-h                 UNASSIGNED
;ctrl-shift-i                 wiki link to [wikt:]ionary or [w:]ikipedia, [[wikt:selected text|selected text]]
;ctrl-shift-j                 UNASSIGNED
;ctrl-shift-k                 UNASSIGNED
;ctrl-shift-l                 colspan= (table style code)
;ctrl-shift-m                 UNASSIGNED
;ctrl-shift-n                 DO NOT USE - Irfanview image to negative switch key
;ctrl-shift-o                 inserts template {{Now Commons}} for images transferred from wikipedia 
;ctrl-shift-p                 {{ping|}}
;ctrl-shift-q                 UNASSIGNED
;ctrl-shift-r                 UNASSIGNED
;ctrl-shift-s                 DO NOT USE - RESERVED BY FIREFOX
;ctrl-shift-t                 pt.5 (ts|table style code pad top .5em)
;ctrl-shift-u                 UNASSIGNED
;ctrl-shift-v                 UNASSIGNED
;ctrl-shift-w                 rowspan= (table code)
;ctrl-shift-x                 UNASSIGNED
;ctrl-shift-y                 UNASSIGNED
;ctrl-shift-z                 UNASSIGNED
;ctrl-t                       UNASSIGNED
;ctrl-u                       UNASSIGNED
;ctrl-v                       DO NOT USE - PASTE SELECTION KEY IN ALL OPERATING SYSTEMS
;ctrl-w                       UNASSIGNED
;ctrl-win-y                   {Asc 0176} ° degree indicator 
;ctrl-x                       DO NOT USE - CUT SELECTION KEY IN ALL OPERATING SYSTEMS
;ctrl-y                       UNASSIGNED
;ctrl-z                       DO NOT USE - REVERT LAST ACTION KEY IN ALL OPERATING SYSTEMS
;win--                        {{fs|%|selected text}} font-size
;win-0                        <div>selected{{Div end}}
;win-1                        <section end=E />
;win-2                        <section end=E /><section begin=B />{Left 3}
;win-3                        <section end=B />
;win-4                        UNASSIGNED
;win-5                        UNASSIGNED
;win-6                        UNASSIGNED
;win-7                        UNASSIGNED
;win-8                        {{fs85|selected text}} without centering
;win-9                        {{fs90|selected text}} without centering
;win-a                        {{anchor|D}} at the left margin
;win-b                        HTML bold <b>selected text</b>
;win-c                        {{c|''selected text''}} center and italicize selected text
;win-d                        hanging indent image caption <div {{ts|width:96%|mc|aj|sm85|lh11|it}}>selected text{{Div end}}
;win-down                     inserts {{hwe| at the beginning og the row
;win-e                        {{anchor|D}} any place
;win-f                        DO NOT USE - RESERVED BY WINDOWS
;win-g                        UNASSIGNED
;win-h                        UNASSIGNED
;win-i                        {{SIC|selected text|selected text|}}
;win-j                        UNASSIGNED
;win-k                        UNASSIGNED
;win-l                        DO NOT USE - LOCKS WINDOWS
;win-m                        <!-- neutralizes selected text -->
;win-n                        nbsp  
;win-o                        UNASSIGNED
;win-p                        <poem style="display:table; line-height:130%; font-size:93%; margin-left:auto; margin-right:auto; width:auto;">selected</poem>
;win-q                        UNASSIGNED
;win-r                        {{right|selected text|2em}}
;win-s                        insert in footer {{rule}}\n{{smallrefs}}
;win-t                        table and style definition {| {{ts|mc|sm85|lh11|ar|bc|bgt}}
;win-u                        superscript <sup>selected text</sup>
;win-up                       inserts {{hws| and terminates with "|"
;win-v                        subscript <sub>selected text</sub>
;win-w                        Wikisource images {{Do not move to Commons}}
;win-x                        UNASSIGNED
;win-y                        UNASSIGNED
;win-z                        UNASSIGNED

Autohotkey.ahk[edit]

Last updated: — Ineuw talk 05:05, 15 January 2017 (UTC)

;2017-01-14 7:06pm
;=================
;english wikisource

SetWorkingDir, D:\AHKFunctionsLibrary

#Include D:\AHKFunctionsLibrary

#Include proofread.ahk

#SingleInstance force

#InstallKeybdHook

#NoEnv

#Warn

;alt-ins                      {{under construction}}
!Ins::
    sendinput, {raw}{{under construction}}
return

;alt-del                      inserts "| cstyle  = margin-top:16px; margin-bottom:-0px" missing from image containes  
!Del::
        sendinput, {space}| cstyle  = margin-top:16px`; margin-bottom:-0px
return

;alt-=                        remove braces from mdash —
!=::
clipboard:=
sendinput, ^a^c
clipwait, 0
    in_put:=chr(0x007b)chr(0x007b)chr(0x2014)chr(0x007d)chr(0x007d)
    out_put:=chr(0x2014)
    clipboard:=regexreplace(trim(clipboard), in_put, out_put)
sleep, 0
    sendinput, ^v^{home}
return

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

;alt-.                        DO NOT USE, assigned to the 'proofread.ahk' file.

;alt-1                        }}
!1::
    sendinput, {raw}}}
return

;alt-2                        {{fqm}} floating quotation mark
!2::
    sendinput, {raw}{{fqm}}
return

;alt-3                        {{bar|2}}
!3::
    sendinput, {{}{{}bar|2{}}{}} ;{left 3}
return

;alt-4                        \n{{Dhr}}\n{{rule|4em}}\n{{Dhr}}\n
!4::
    sendinput, {Home}`n
    sendinput, {raw}{{Dhr}}
    sendinput, `n`n
    sendinput, {raw}{{rule|4em}}
    sendinput, `n`n
    sendinput, {raw}{{Dhr}}
    sendinput, `n
return

;alt-5                        \n{{Dhr}}\n{{rule|65%}}{{rule|65%}}\n{{Dhr}}\n
!5::
    sendinput, {Home}`n
    sendinput, {raw}{{Dhr}}
    sendinput, `n`n
    sendinput, {raw}{{rule|65`%}}{{rule|65`%}}
    sendinput, `n`n
    sendinput, {raw}{{Dhr}}
    sendinput, `n
return

;alt-6                        {{Dhr|2.5em}}\n{{rule|12em}}
!6::
    sendinput, {Home}`n
    sendinput, {raw}{{Dhr|2.5em}}
    sendinput, `n`n
    sendinput, {raw}{{rule|12em}}
    sendinput, `n
return

;alt-7                        {{c|{{fs75|selected text}}}}
!7::
selected:=
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard={{c|{{fs75|%selected%}}}}
    sendinput, ^v
return

;alt-8                        {{c|{{fs85|selected text}}}}
!8::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard={{c|{{fs85|%selected%}}}}
    sendinput, ^v
return

;alt-9                        {{c|{{fs90|selected text}}}}
!9::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard={{c|{{fs90|%selected%}}}}
    sendinput, ^v
return

;alt-0                        <div {{ts|ptb.5|lh12}}>%selected%{{Div end}}
!0::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:= trim(clipboard)
    clipboard=<`div {{ts|ptb.5|lh12}}`>%selected%{{Div end}}
    sendinput, ^v
return

;alt-a                        UNASSIGNED
;!a::
;
return

;alt-b                        bold '''selected text'''
!b::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=clipboard
    if (substr(selected, 0)=A_space)
    {
    selected:=trim(selected)
    clipboard='''%selected%'''%A_space%
}
Else
{
    selected:=trim(selected)
    clipboard='''%selected%'''
}
    sendinput, ^v
return

;alt-c                        {{center|selected text}}
!c::
selected:=
clipboard:=
sendinput, ^x
clipwait, 0
    selected:=trim(clipboard)
    sendinput, {Home}
    clipboard={{c|%selected%}}
    sendinput, ^v
return

;alt-d                        \n{{Dhr}}\n
!d::
    sendinput, {Home}`n{{}{{}Dhr{}}{}}`n
return

;alt-e                        inserts | vertical bar at the beginning of the row for table row
!e::
    sendinput, {Home}|{Down}
return

;alt-f                        FIS image container
!f::
    sendinput, {Home}{{}{{}FIS`n
    sendinput, {Home} | file         = `n
    sendinput, {Home} | width        = 500px|250px`n
    sendinput, {Home} | cstyle       = margin-top:16px`; margin-bottom:-0px`n
    sendinput, {Home} | float        = left|none|right`n
    sendinput, {Home} | caption      = `n
    sendinput, {Home} | talign       = center|justify`n
    sendinput, {Home} | tstyle       = font-size:83`%; font-variant:small-caps`n
    sendinput, {Home} | margin-right = 12px`n
    sendinput, {Home} | margin-left  = 12px`n
    sendinput, {Home} | tmleft       = 11px`n
    sendinput, {Home} | indent       =-11px`n
    sendinput, {Home}{}}{}}
return

;alt-g                        {{gap}}
!g::
    sendinput, {raw}{{gap}}
return

;alt-h                        {{fs75|{{sfrac||}}}} for reduced fon-size fractions
!h::
    sendinput, {raw}{{fs75|{{sfrac||}}}}%A_space%
    sendinput, {Left 6}
return

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

;alt-j                        {{left|selected text|2em}}
!j::
    sendinput, {Home}
    sendinput, {raw}{{left|
    sendinput, {End}
    sendinput, {raw}|2em}}
return

;alt-k                        |ptb.5  {{ts|table style code}} pad top and pad bottom .5 em
!k::
    sendinput, `|ptb.5`{left 6`}{`down`}
return

;alt-l                        {{Plr|selected text}} 
!l::
clipboard:=
sendinput, ^c
clipwait, 0
    clipboard:=trim(clipboard)
    clipboard={{Plr|%clipboard%}}
    sendinput, ^v
return

;alt-m                        inserts emdash —
!m::
    sendinput, {u+2014}
return

;alt-n                        {{nop}}
!n::
    sendinput, {Home}
    sendinput, {raw}{{nop}}
return

;alt-o                        copy title from 1st line of the text body into the correct segment of the running header template 
!o::
clipboard:=
    send, ^x
    clipboard:= trim(clipboard)
    clipboard= `{{rh||''%clipboard%''|}}
    send, +{tab}
    send, ^v
    send {end}{left}{left} 
return


;alt-p                        {{rh||''THE POPULAR SCIENCE MONTHLY.''|}}
!p::
    send, {raw}{{rh||''THE POPULAR SCIENCE MONTHLY.''|}}
    sendinput, {Home}{Right 5}
return

;alt-q                        DO NOT USE - RESERVED FOR TEXTPAD
;!q::
return

;alt-r                        create open and close reference tag and move cursor between the two <ref></ref>
!r::
        sendinput, `<ref`>`</ref`>{left 6}
return

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

;alt-t                        created {{ts|}}| for table style code input
!t::
    sendinput, {raw}{{ts|}}|
    sendinput, {Left 3}
return

;alt-u                        UNASSIGNED
;!u::
;
return

;alt-v                        {{di|D}}rop initial at the beginning of the line
!v::
    sendinput, {Home}
    sendinput, {raw}{{di|
    sendinput, {Right}
    sendinput, {raw}}}
return

;alt-w                        width= table style code
!w::
    sendinput, width= {left}
return

;alt-x                        UNASSIGNED
!x::
    sendinput, !+s
return

;alt-y                        {Asc 0183} · center dot used as decimal point until 1880s
!y::
    sendinput, {Asc 0183}
return

;alt-z                        remove unicode null characters in scanned text
!z::
clipboard:=
send, ^{Home}^a^c
in_put:= chr(0xfffd)
out_put:= ""
clipboard:=regexreplace(clipboard, in_put, out_put)
send, ^v{bs}{bs}{bs}
return

;=====================================

;alt-shift-0                  UNASSIGNED
;!+0::
;
return

;alt-shift-a                  {{color|red|''Arabic missing''}}
!+a::
    sendinput, {raw}{{color|red|''Arabic missing''}}
return

;alt-shift-b                  UNASSIGNED
;!+b::
;
return

;alt-shift-c                  UNASSIGNED
;!+c::
;
return

;alt-shift-d                  <div style="text-align:center; font-family:serif serif; font-style:normal; font-weight:500;"{{Div end}}
!+d::
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard=`<div style="text-align:center; font-family:serif serif; font-style:normal; font-weight:500;">`n%selected%`{{Div end}}
    sendinput, ^v
return

;alt-shift-e                  UNASSIGNED
;!+e::
;
return

;alt-shift-f                  UNASSIGNED
;!+f::
;
return

;alt-shift-g                  {{color|red|''Greek missing''}}
!+g::
    sendinput, {raw}{{color|red|''Greek missing''}}
return

;alt-shift-h                  {{he|}} hebrew RTL
!+h::
    sendinput, {{}{{}he|{}}{}}{Left 2}
return

;alt-shift-i                  types 'Cleaned image and improved contrast'
!+i::
    sendinput, {raw}Cleaned image and improved contrast
return

;alt-shift-j                  UNASSIGNED
;!+j::
;
return

;alt-shift-k                  UNASSIGNED
;!+k::
;
return

;alt-shift-l                  DO NOT USE - LOCKS SCREEN IN WINDOWS
;!+l::
return

;alt-shift-m                  UNASSIGNED
;!+m::
;
return

;alt-shift-n                  UNASSIGNED
;!+n::
;
return

;alt-shift-o                  UNASSIGNED
;!+o::
;
return

;alt-shift-p                  DO NOT USE - Preview key in Wikipedia software
;!+p::
return

;alt-shift-q                  UNASSIGNED
;!+q::
;
return

;alt-shift-r                  UNASSIGNED
;!+r::
;
return

;alt-shift-s                  DO NOT USE - Save key in Wikipedia
;!+s::
;
return

;alt-shift-t                  UNASSIGNED
;!+t::
;
return

;alt-shift-u                  UNASSIGNED
;!+u::
;
return

;alt-shift-v                  UNASSIGNED
;!+v::
;
return

;alt-shift-w                  inserts template {{PSM link|Title|Volume|Month&Year|author=}}
!+w::
    sendinput, {raw}{{PSM link|ttl|vol|mmmmyyyy|author=}}
return

;alt-shift-x                  UNASSIGNED
;!+x::
;
return

;alt-shift-y                  UNASSIGNED
;!+y::
;
return

;alt-shift-z                  UNASSIGNED
;!+z::
;
return

;======================================

;ctrl-\                       re-load this edited and saved .ahk file
^\::
    Reload
return

;ctrl-a                       DO NOT USE - SELECT ALL in all Operating systems
;^a::
;
return

;ctrl-b                       UNASSIGNED
^b::
        sendinput, {raw}<br>
return

;ctrl-c                       DO NOT USE - COPY selected in all Operating systems
;^c::
return

;ctrl-d                       UNASSIGNED
;^d::
;
return

;ctrl-e                       UNASSIGNED
;^e::
;
return

;ctrl-f                       UNASSIGNED
;^f::
;
return

;ctrl-g                       UNASSIGNED
;^g::
;
return

;ctrl-h                       UNASSIGNED
;^h::
;
return

;ctrl-i                       UNASSIGNED
;^i::
;
return

;ctrl-j                       UNASSIGNED
;^j::
;
return

;ctrl-k                       {{sic}}
^k::
    sendinput, {raw}{{sic}}
return

;ctrl-l                       UNASSIGNED
;^l::
;
return

;ctrl-m                       <math>selected</math>
^m::
selected:=
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard=`<math`>%selected%`</math`>
    sendinput, ^v
return

;ctrl-n                       UNASSIGNED
;^n::
;
return

;ctrl-o                       UNASSIGNED
;^o::
;
return

;ctrl-p                       \n<p>\n
^p::
    sendinput, `n`<p`>`n
return

;ctrl-q                       UNASSIGNED
;^q::
;
return

;ctrl-r                       UNASSIGNED
;^r::
;
return

;ctrl-s                       DO NOT USE - SAVE key in all Operating systems
;^s::
return

;ctrl-t                       UNASSIGNED
;^t::
return

;ctrl-u                       UNASSIGNED
;^u::
;
return

;ctrl-v                       DO NOT USE - PASTE SELECTION key in all Operating systems
;^v::
return

;ctrl-w                       UNASSIGNED
;^w::
;
return

;ctrl-x                       DO NOT USE - CUT SELECTION key in all Operating systems
;^x::
;
return

;ctrl-y                       UNASSIGNED
;^y::
;
return

;ctrl-z                       DO NOT USE - REVERT LAST ACTION key in all Operating systems
;^z::
;
return

;======================================

;ctrl-shift-1                 UNASSIGNED
;^+1::
;
return

;ctrl-shift-2                 UNASSIGNED
;^+2::
;
return

;ctrl-shift-3                 UNASSIGNED
;^+3::
;
return

;ctrl-shift-4                 inserts 4 spaces (instead of Tab)
^+4::
    sendinput, %A_Space%%A_Space%%A_Space%%A_Space%
return

;ctrl-shift-5                 UNASSIGNED
;^+5::
;
return

;ctrl-shift-6                 UNASSIGNED
;^+6::
;
return

;ctrl-shift-7                 UNASSIGNED
;^+7::
;
return

;ctrl-shift-8                 {{fs85/s}}selected text{{fs85/e}}
^+8::
clipboard:=
sendinput, ^c
clipwait, 0
    clipboard={{fs85/s}}%clipboard%{{fs85/e}}
    sendinput, ^v
return

;ctrl-shift-9                 {{fs90/s}}selected text{{fs90/e}}
^+9::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard={{fs90/s}}%selected%{{fs90/e}}
    sendinput, ^v
return

;ctrl-shift-0                 UNASSIGNED
;^+0::
;
return

;ctrl-shift-a                 UNASSIGNED
;^+a::
;
return

;ctrl-shift-b                 inserts |pb.5 {{ts|pad bottom .5em table style code}}
^+b::
    sendinput, `|pb.5`{left 5`}`{down`}
return

;ctrl-shift-c                 {{colors|black|LightSalmon|selected text}}
^+c::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=clipboard
    if (substr(selected, 0)=A_space)
    {
    selected:=trim(selected)
    clipboard={{colors|black|LightSalmon|%clipboard%}}%A_space%
}
else
{
    selected:=trim(selected)
    clipboard={{colors|black|LightSalmon|%clipboard%}}
}
    sendinput, ^v
return

;ctrl-shift-d                 UNASSIGNED
;^+d::
;
return

;ctrl-shift-e                 UNASSIGNED
;^+e::
;
return

;ctrl-shift-f                  font size {{fs||selected}}
^+f::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard={{fs|`%|%selected%}}
    sendinput, ^v{home}{right 5}
return

;ctrl-shift-g                 UNASSIGNED
;^+g::
;
return

;ctrl-shift-h                 UNASSIGNED
;^+h::
;
return

;ctrl-shift-i                 wiki link to [wikt:]ionary or [w:]ikipedia, [[wikt:selected text|selected text]]
^+i::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    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-j                 UNASSIGNED
;^+j::
;
return

;ctrl-shift-k                 UNASSIGNED
;^+k::
;
return

;ctrl-shift-l                 colspan= (table style code)
^+l::
    sendinput, colspan= {left}
return

;ctrl-shift-m                 UNASSIGNED
;^+m::
;
return

;ctrl-shift-n                 DO NOT USE - Irfanview image to negative switch key
;^+n::
return

;ctrl-shift-o                 inserts template {{Now Commons}} for images transferred from wikipedia 
^+o::
    sendinput, {raw}{{Now Commons}}
return

;ctrl-shift-p                 {{ping|}}
^+p::
    sendinput, {raw}{{ping|}}
    sendinput, {Left 2}
return

;ctrl-shift-q                 UNASSIGNED
;^+q::
;
return

;ctrl-shift-r                 UNASSIGNED
;^+r::
;
return

;ctrl-shift-s                 DO NOT USE - RESERVED BY FIREFOX
^+s::
return

;ctrl-shift-t                 pt.5 (ts|table style code pad top .5em)
^+t::
    sendinput, `|pt.5`{left 5`}`{down`}
return

;ctrl-shift-u                 UNASSIGNED
;^+u::
;
return

;ctrl-shift-v                 UNASSIGNED
;^+v::
;
return

;ctrl-shift-w                 rowspan= (table code)
^+w::
    sendinput, rowspan= {Left 1}
return

;ctrl-shift-x                 UNASSIGNED
;^+x::
;
return

;ctrl-shift-y                 UNASSIGNED
;^+y::
;
return

;ctrl-shift-z                 UNASSIGNED
;^+z::
;
return

;======================================

;ctrl-win-y                   {Asc 0176} ° degree indicator 
^+y::
    sendinput, {Asc 0176}
return

;======================================

;win-down                     inserts {{hwe| at the beginning og the row
#down::
    sendinput, {Home}
    sendinput, {raw}{{hwe|
return

;win-up                       {{hws|
#up::
    sendinput, {raw}{{hws|
    sendinput, {end}|
return

;win--                        {{fs|%|selected text}} font-size
#-::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=clipboard
    if (substr(selected, 0)=A_space)
    {
    selected:=trim(selected)
    clipboard={{fs|`%|%selected%}}%A_space%
}
else
{
    selected:=trim(selected)
    clipboard={{fs|`%|%selected%}}
}
    sendinput, ^v
return

;win-1                        <section end=E />
#1::
    sendinput, {Home}`<section begin=E `/`>{Left 3}
return

;win-2                        <section end=E /><section begin=B />{Left 3}
#2::
    sendinput, `n
    sendinput, `<section end=E `/`>`<section begin=B `/`>
    sendinput, {Left 22}
return

;win-3                        <section end=B />
#3::
    sendinput, `<section end=B `/`>{Left 3}
return

;win-4                        UNASSIGNED
;#4::
;
return

;win-5                        UNASSIGNED
;#5::
;
return

;win-6                        UNASSIGNED
;#6::
;
return

;win-7                        UNASSIGNED
;#7::
;
return

;win-8                        {{fs85|selected text}} without centering
#8::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    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-9                        {{fs90|selected text}} without centering
#9::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=clipboard
    if (substr(selected, 0)=A_space)
    {
    selected:=trim(selected)
    clipboard={{fs90|%selected%}}
}
else
{
    selected:=trim(selected)
    clipboard={{fs90|%selected%}}
}
    sendinput, ^v
return

;win-0                        <div>selected{{Div end}}
#0::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:= trim(clipboard)
    clipboard=`<div`>%selected%{{Div end}}
    sendinput, ^v
return

;win-a                        {{anchor|D}} at the left margin
#a::
    sendinput, {Home}
    sendinput, {raw}{{anchor|D}}
    sendinput, {Left 2}
return

;win-b                        HTML bold <b>selected text</b>
#b::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    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-c                        {{c|''selected text''}} center and italicize selected text
#c::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    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-d                        hanging indent image caption <div {{ts|width:96%|mc|aj|sm85|lh11|it}}>selected text{{Div end}}
#d::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard=`<div {{ts|width:96`%|mc|aj|sm85|lh11|it|pb.5}}`>`n%selected%`n{{Div end}}
    sendinput, ^v
return

;win-e                        {{anchor|D}} any place
#e::
    sendinput, {raw}{{anchor|D}}
    sendinput, {Left 2}
return

;win-f                        DO NOT USE - RESERVED BY WINDOWS
#f::
return

;win-g                        UNASSIGNED
;#g::
return

;win-h                        UNASSIGNED
;#h::
return

;win-i                        {{SIC|selected text|selected text|}}
#i::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    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-j                        UNASSIGNED
;#j::
;
return

;win-k                        UNASSIGNED
;#k::
;
return

;win-l                        DO NOT USE - LOCKS WINDOWS
;#l::
return

;win-m                        <!-- neutralizes selected text -->
#m::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard=`<!--%A_space%%selected%%A_space%--`>
    sendinput, ^v
return

;win-n                         
#n::
    sendinput, {raw} 
return

;win-o                        UNASSIGNED
;#o::
;
return

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

;win-q                        UNASSIGNED
;#q::
;
return

;win-r                        {{right|selected text|2em}}
#r::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard={{right|%selected%|2em}}
    sendinput, ^v
return

;win-s                        insert in footer {{rule}}\n{{smallrefs}}
#s::
clipboard:=
    sendinput, ^a{Del}^{Home}
    sendinput, {{}{{}rule{}}{}}`n{{}{{}smallrefs{}}{}}`n
return

;win-t                        table and style definition {| {{ts|mc|sm85|lh11|ar|bc|bgt}}
#t::
clipboard:=
sendinput, ^c
clipwait, 0
    clipboard=`{| `{`{ts|mc|sm85|lh11|ar|bc|bgt`}`}
    sendinput, ^v
return

;win-u                        superscript <sup>selected text</sup>
#u::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard=<sup>%selected%</sup>
    sendinput, ^v
return

;win-v                        subscript <sub>selected text</sub>
#v::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard=<sub>%selected%</sub>
    sendinput, ^v
return

;win-w                        Wikisource images {{Do not move to Commons}}
#w::
    sendinput {raw}{{Do not move to Commons}}
return

;win-x                        UNASSIGNED
#x::
;
return

;win-y                        UNASSIGNED
#y::
;
return

;win-z                        UNASSIGNED
;#z::
;
return

;======================================

Proofread.ahk[edit]

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

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

clipwait, 0

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

sleep, 500

clipclear:=

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