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 04:18, 1 November 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--                        inserts emdash —
;alt-.                        DO NOT USE, assigned to the 'proofread.ahk' file.
;alt-0                        `<div`>selected`<`/div`>
;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}}newline{{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                        UNASSIGNED
;alt-c                        {{center|selected text}}
;alt-d                        \n{{Dhr}}\n
;alt-del                      inserts "| cstyle = margin-top:16px; margin-bottom:-0px" missing from image container  
;alt-e                        inserts | vertical bar at the beginning of the row for table cell
;alt-end                      UNASSIGNED
;alt-f                        FIS image container
;alt-g                        {{gap}}
;alt-h                        {{fs|90`%|{{frac||}}}} 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                        `<math`>`\`<`/math`>
;alt-n                        {{nop}}
;alt-o                        copy selected title from 1st line of the text body into the title 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-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 REPLACEMENT CHARACTER character in scanned text
;alt-shift-0                  `<div style="width:540px; text-align:center; padding-top:4em; line-height:120`%; font-size:95`%; font-family:serif;"`>n%selected%`<`/div`>
;alt-shift-9                  {{fs90|selected text}}
;alt-shift-a                  UNASSIGNED
;alt-shift-b                  inserts |pb.5 {{ts|pad bottom .5em table style code}}
;alt-shift-c                  UNASSIGNED
;alt-shift-d                  UNASSIGNED
;alt-shift-e                  DO NOT USE Wikipedia hotkey for edit page
;alt-shift-f                  UNASSIGNED
;alt-shift-g                  UNASSIGNED
;alt-shift-h                  UNASSIGNED
;alt-shift-i                  'Cleaned image and added frame'
;alt-shift-j                  UNASSIGNED
;alt-shift-k                  UNASSIGNED
;alt-shift-l                  inserts |pl.5 {{ts|pad left .5em table style code}}
;alt-shift-m                  UNASSIGNED
;alt-shift-n                  UNASSIGNED
;alt-shift-o                  UNASSIGNED
;alt-shift-p                  DO NOT USE - preview key in wmf software
;alt-shift-q                  UNASSIGNED
;alt-shift-r                  inserts |pr.5 {{ts|pad right .5em table style code}}
;alt-shift-s                  DO NOT USE - save key in wmf software
;alt-shift-t                  inserts |pt.5 {{ts|pad top .5em table style code}}
;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
;ctrl-'                       prime symbol
;ctrl-\                       re-load any edited and saved .ahk file
;ctrl-a                       DO NOT USE - SELECT ALL in all Operating systems
;ctrl-b                       `<br`>
;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                       `\Sigma
;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                 UNASSIGNED
;ctrl-shift-c                 {{colors|black|LightGreen|selected text}}
;ctrl-shift-d                 UNASSIGNED
;ctrl-shift-e                 UNASSIGNED
;ctrl-shift-f                 font size {{fs||selected}}
;ctrl-shift-g                 UNASSIGNED
;ctrl-shift-h                 {{lh2`/s|125`%}}selected`<`/div`>
;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                 `<ce`>selected`<`/ce`>
;ctrl-shift-n                 DO NOT USE - Irfanview image 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                 DO NOT USE - firefox reload key
;ctrl-shift-s                 DO NOT USE - RESERVED BY FIREFOX
;ctrl-shift-t                  insert`<`> `<`/`>
;ctrl-shift-u                 {Asc 0146} ′ minute indicator
;ctrl-shift-v                 UNASSIGNED
;ctrl-shift-w                 rowspan= (table code)
;ctrl-shift-x                 UNASSIGNED
;ctrl-shift-y                 {Asc 0176} ° degree indicator
;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-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-'                        to be edited to search for floating single or double quote 
;win--                        {{fs|`%|selected text}} font-size
;win-0                        UNASSIGNED
;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                        {{fs|90`%|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                        image caption `<div {{ts|width:540px|mc|aj|sm85|lh11|ptb.5}}`>selected text`<`/div`>
;win-down                     inserts {{hwe| at the beginning of a row
;win-e                        {{anchor|D}} any place
;win-f                        DO NOT USE - RESERVED BY WINDOWS
;win-g                        {{c|sc|selected text}}
;win-h                        UNASSIGNED
;win-i                        {{SIC|selected text|selected text|}}
;win-j                        {{right|selected text|2em}}
;win-k                        UNASSIGNED
;win-l                        DO NOT USE - LOCKS WINDOWS
;win-m                        `<!-- neutralize selected text --`>
;win-n                         
;win-o                        UNASSIGBED
;win-p                        `<poem style="display:table; line-height:120`%; font-size:90`%; margin-left:auto; margin-right:auto; width:auto;"`>selected`<`/poem`>
;win-q                        UNASSIGNED
;win-r                        <ref>%selected%</ref>
;win-s                        insert in footer {{rule}}\n{{smallrefs}}
;win-t                        table and style definition {| {{ts|bt|bb|mc|sm85|lh11|ar|bc|bgt}}
;win-u                        superscript `<sup`>selected text`<`/sup`>
;win-up                       enclosed text with {{hws| 
;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 04:19, 1 November 2017 (UTC)

;2017-10-23 08:08 PM
;===================
;english wikisource

SetWorkingDir, D:\ahk_functions_library

#Include D:\ahk_functions_library

#Include proofread.ahk
;#Include proofreadnowrap.ahk

#SingleInstance force

#InstallKeybdHook

#NoEnv

#Warn

SetTimer, AutoReload, 60000

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

;alt-del                      inserts "| cstyle = margin-top:16px; margin-bottom:-0px" missing from image container  
!del::
    sendinput, {space}| cstyle  = margin-top:15px`; margin-bottom:-0px`n{space}| tstyle  = padding-top:.5em; font-variant:small-caps
    sendinput, {left 25}
return

;alt-end                      UNASSIGNED
;!end::
;
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--                        inserts emdash —
!-::
    sendinput, {u+2014}
return

;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}}newline{{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`>selected`<`/div`>
!0::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:= trim(clipboard)
    clipboard=`<div`>%selected%`<`/div`>
    sendinput, ^v
return

;alt-a                        UNASSIGNED
;!a::
;clipboard:=
;sendinput, ^a^c
;in_put:=
;out_put:=
;clipboard:=regexreplace(clipboard, in_put, out_put)
;sendinput, ^v
return

;alt-b                        UNASSIGNED
;!b::
;
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 cell
!e::
    sendinput, {Home}|{Down}
return

;alt-f                        FIS image container
!f::
    sendinput, {Home}{{}{{}FIS`n
    sendinput, {Home} | file         = `n
    sendinput, {Home} | width        = 540px|265px`n
    sendinput, {Home} | cstyle       = margin-top:15px`; margin-bottom:-0px`n
    sendinput, {Home} | tstyle       = padding-top:.5em; font-variant:small-caps`n
    sendinput, {Home} | float        = left|none|right`n
    sendinput, {Home} | caption      = `n
    sendinput, {Home} | talign       = center|justify`n
    sendinput, {Home} | margin-right = 10px`n
    sendinput, {Home} | margin-left  = 10px`n
    sendinput, {Home} | tmleft       = 10px`n
    sendinput, {Home} | indent       =-10px`n
    sendinput, {Home}{}}{}}
return

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

;alt-h                        {{fs|90`%|{{frac||}}}} for reduced fon-size fractions
!h::
    sendinput, {raw}{{fs|90`%|{{frac|1|2}}}}
    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                        `<math`>`\`<`/math`>
!m::
    sendinput, {raw}`<math`>`\`<`/math`>
    sendinput, {left 7}
return

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

;alt-o                        copy selected title from 1st line of the text body into the title segment of the running header template
!o::
clipboard:=
sendinput, ^x
clipwait, 0
    clipboard:=trim(clipboard)
    sendinput, +{tab}

    send, {raw}{{rh||''
    send, %clipboard%
    send, {raw}''|}}
    sendinput, {left 2}

    ;send, {raw}{{fs90|{{rh||
    ;send, %clipboard%
    ;send, {raw}|}}}}
    ;sendinput, {left 4}

return

;alt-p                        {{rh||''THE POPULAR SCIENCE MONTHLY''|}}
!p::
    sendinput, {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, {home}{return}
return

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

;alt-z                        remove unicode REPLACEMENT CHARACTER character in scanned text
!z::
clipboard:=
sendinput, ^{Home}^a^c
clipwait, 0
    clipboard:= regexreplace(clipboard, chr(0xfffd), "")
clipwait, 0
    sendinput, ^v
clipwait, 0
sendinput, {bs 3}
return

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

;alt-shift-0                  `<div style="width:540px; text-align:center; padding-top:4em; line-height:120`%; font-size:95`%; font-family:serif;"`>n%selected%`<`/div`>
!+0::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
clipwait, 0
    clipboard=`<div style="width:540px; text-align:center; padding-top:4em; line-height:120`%; font-size:95`%; font-family:serif;"`>`n%selected%`n`<`/div`>
    sendinput, ^v
return

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

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

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

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

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

;alt-shift-e                  DO NOT USE Wikipedia hotkey for page edit
;!+e::
;
return

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

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

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

;alt-shift-i                  'Cleaned image and added frame'
!+i::
    sendinput, {raw}Cleaned image and added frame
return

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

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

;alt-shift-l                  inserts |pl.5 {{ts|pad left .5em table style code}}
!+l::
    sendinput, `|pl.5`{left 5`}`{down`}
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 wmf software
;!+p::
return

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

;alt-shift-r                  inserts |pr.5 {{ts|pad right .5em table style code}}
!+r::
    sendinput, `|pr.5`{left 5`}`{down`}
return

;alt-shift-s                  DO NOT USE - save key in wmf software
;!+s::
;
return

;alt-shift-t                  inserts |pt.5 {{ts|pad top .5em table style code}}
!+t::
    sendinput, `|pt.5`{left 5`}`{down`}
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-'                       prime symbol
;^'::
;    sendinput, 
return

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

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

;ctrl-b                       `<br`>
^b::
    sendinput, `<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)
    if (substr(selected, 0)=A_space)
    {
    selected:=trim(selected)
    clipboard=`<math`>%selected%`<`/math`>%A_space%
}
else
{
    selected:=trim(selected)
    clipboard=`<math`>%selected%`<`/math`>
}
    ;sendinput, %clipboard%
    sendinput, ^v
return

;ctrl-n                       `\Sigma
;^n::
;    sendinput, {raw}`\Sigma
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                 UNASSIGNED
;^+b::
;
return

;ctrl-shift-c                 {{colors|black|LightGreen|selected text}}
^+c::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=clipboard
    if (substr(selected, 0)=A_space)
    {
    selected:=trim(selected)
    clipboard={{colors|black|LightGreen|%clipboard%}}%A_space%
}
else
{
    selected:=trim(selected)
    clipboard={{colors|black|LightGreen|%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                 {{lh2`/s|125`%}}selected`<`/div`>
^+h::
selected:=
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard={{lh2`/s|125`%}}%selected%`<`/div`>
    sendinput, ^v
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 1}
return

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

;ctrl-shift-n                 DO NOT USE - Irfanview image 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                 DO NOT USE - firefox reload key
;^+r::
;
return

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

;ctrl-shift-t                  insert`<`> `<`/`>
^+t::
    sendinput, {raw}`<`>`<`/`>
    sendinput, {left 4}
return

;ctrl-shift-u                 {Asc 0146} ′ minute indicator
^+u::
    send, {Asc 0146}
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                 {Asc 0176} ° degree indicator
^+y::
    send, {Asc 0176}
return

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

; win ======================================

;win-'                        to be edited to search for floating single or double quote 
#'::
    sendinput, ^{home}
    sendinput, ^f
    sendinput, ^a 
    send, {del}
    sendinput, %A_space%"%A_space%
return

;win-down                     inserts {{hwe| at the beginning of a row
#down::
    sendinput, {Home}
    sendinput, {raw}{{hwe|
    sendinput, ^{right}{left}|
    sendinput, {raw}}}
    sendinput, {left 2}
return

;win-up                       enclosed text with {{hws| 
#up::
    sendinput, {backspace}^{left}{{}{{}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`<section end=E `/`>`<section begin=B `/`>{Left 22}
return

;win-3                        `<section end=B `/`>
#3::
    sendinput, ^{end} `<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                        {{fs|90`%|selected text}} without centering
#9::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=clipboard
    if (substr(selected, 0)=A_space)
    {
    selected:=trim(selected)
    clipboard={{fs|90`%|%selected%}}%A_space%
}
else
{
    selected:=trim(selected)
    clipboard={{fs|90`%|%selected%}}
}
    sendinput, ^v

return

;win-0                        UNASSIGNED
;#0::
;
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                        image caption for 540px width `<div {{ts|width:540px;|mc|aj|sm85|lh11|ptb.5}}`>selected text`<`/div`>
#d::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard=`<div {{ts|width:540px;|mc|aj|sm85|lh11|ptb.5}}`>`n%selected%`n`<`/div`>
    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                        {{c|sc|selected text}}
#g::
autotrim, off
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    if (substr(selected, 0)=A_space)
    {
    selected:=trim(selected)
    clipboard={{c|{{sc|%selected%}}}}%A_space%
}
else
{
    selected:=trim(selected)
    clipboard={{c|{{sc|%selected%}}}}
}
    sendinput, ^v
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                        {{right|selected text|2em}}
#j::
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=trim(clipboard)
    clipboard={{right|%selected%|2em}}
    sendinput, ^v
return

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                        UNASSIGBED
;#o::
;
return

;win-p                        `<poem style="display:table; line-height:120`%; font-size:90`%; 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:120`%; font-size:90`%; margin-left:auto; margin-right:auto; width:auto;"`>`n%selected%`n`<`/poem`>
    sendinput, ^v
return

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

;win-r                        <ref>%selected%</ref>
#r::
autotrim, on
clipboard:=
sendinput, ^c
clipwait, 0
    selected:=clipboard
    clipboard=<ref>%selected%</ref>
    sendinput, ^v
return

;win-s                        insert in footer {{rule}}\n{{smallrefs}}
#s::
run, "D:\ahk_functions_library\autoclipclear.exe"
clipwait, 0
clipboard:=
    sendinput, ^a{Del}^{Home}
    sendinput, `n{{}{{}smallrefs{}}{}}`n
    ;sendinput, `n{{}{{}rule{}}{}}`n{{}{{}smallrefs{}}{}}`n
return

;win-t                        table and style definition {| {{ts|bt|bb|mc|sm85|lh11|ar|bc|bgt}}
#t::
clipboard:=
sendinput, ^c
clipwait, 0
    clipboard=`{| `{`{ts|mc|sm85|lh11|ar|bc|bgt`}`} border
    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::
    sendinput, !+s
return

AutoReload:

Reload

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