User:Ineuw/AutoHotKey

From Wikisource
Jump to: navigation, search

Autohotkey.ahk keyboard macros script file for proofreading - in Windows XP or Windows 7 - .

Last update: 20:38, 15 March 2015 (UTC)

Autohotkey macro key assignment list[edit]

;Alt+'         ''selected text''
;Alt+0         {{larger|selected text}}
;Alt+1         }}
;Alt+2         {{}}
;Alt+3         {{ar|}}
;Alt+4         {{Dhr}}{{rule|4em}}{{Dhr}}
;Alt+5         {{Dhr}} {{rule|65%}}{{rule|65%}}{{Dhr}}
;Alt+6         {{Dhr}} {{rule|12em}} {{Dhr}}
;Alt+7         {{c|{{fs75|selected text}}}}
;Alt+8         {{c|{{fs85|selected text}}}}
;Alt+9         {{c|{{fs90|selected text}}}}
;Alt+Dn        {{hwe|
;Alt+Up        {{hws|
;Alt+a         [[Category:|]]
;Alt+b         '''selected text'''
;Alt+c         {{c|selected text}}
;Alt+d         {{Dhr}}
;Alt+e         | vertical bar at the beginning of the row for tables
;Alt+f         FIS images container
;Alt+g         {{gap}}
;Alt+h         {{fs70|{{sfrac||}}}} OR {{fs70|{{over||}}}} both are the same
;Alt+i         <i>selected text</i>
;Alt+j         {{left|selected text|2em}}
;Alt+k         |ptb.5 Table code
;Alt+l         {{Plr|selected text}}
;Alt+m         em dash —
;Alt+n         {{nop}}
;Alt+o         {{rh||'' ''|}}
;Alt+p         {{rh||''THE POPULAR SCIENCE MONTHLY.''|}}
;Alt+r         <ref>selected text</ref>
;Alt+s         {{sc|selected text}}
;Alt+t         ts|al
;Alt+v         {{di|D}}rop initial at the beginning of the line
;Alt+w         width= table code
;Alt+y         · 
;Alt+z         {{image}}
;======
;Win+1         <section end=E />
;Win+2         <section end=E /><section begin=B />{Left 3}
;Win+3         <section end=B />
;Win+8         {{fs85|selected text}}
;Win+9         {{c|{{fs90|selected text}}}}
;Win+a         {{anchor|D}}
;Win+b         <b>selected text</b>
;Win+c         {{color|red|selected text}}
;Win+d         <div {{ts|width:430px;|ma|aj|sm85|lh11|it}}>selected text</div>
;Win+h         {{hi|selected text}}
;Win+i         {{SIC|selected text||selected text|}}
;Win+n         &nbsp
;Win+o         {{smaller|selected text}}
;Win+p         {{block center/s}}<poem style="line-height:105%; font-size:90%;">selected text</poem>{{block center/e}}
;Win+q         SUBPAGENAME
;Win+r         {{right|selected text|2em}}
;Win+s         {{smallrefs}}
;Win+t         {| {{ts|mc|sm85|lh1|ar|bc|bgt}} <!-- border --> table code
;Win+u         <sup>selected text</sup>
;Win+v         <sub>selected text</sub>
;Win+z         mutipurpose assignments
;======
;Alt+Shift+a   {{color|red|''Arabic missing''}}
;Alt+Shift+b   <br />
;Alt+Shift+h   {{he|}} hebrew
;Alt+Shift+w   {{PSM link|T|V|M&Y|author=}}
;Alt+Sift+l    Do not use - reserved by Windows
;======
;Ctrl+\        Reserved for autokey - reload edited and saved authotkey.ahk
;Ctrl+i        Cleaned image and improved contrast
;Ctrl+j        Replaced Google copyright notice(s) with blank page(s)
;Ctrl+k        {{sic}}
;Ctrl+m        <math></math>
;Ctrl+o        Popular Science Monthly/Contributors
;Ctrl+p        {{ping|{{ROOTPAGENAME}}}}
;======
;CtrlShift+8   {{fs85/se}}
;CtrlShift+9   {{fs90/se}}
;CtrlShift+b   |pb.5 table code
;CtrlShift+i   [[selected text|selected text]]
;CtrlShift+l   colspan= table code
;CtrlShift+n   {{under construction}}
;CtrlShift+p   <p>
;CtrlShift+t   |pt.5 table code
;CtrlShift+u   {{fs85|{{ua|note=hyphenated word was joined on the previous page because of the intervening image.~~~~}}}}
;CtrlShift+w   rowspan= table code
;CtrlShift+y   {Asc 0186} º degree indicator

Autohotkey keyboard macro script[edit]

;#InstallMouseHook
#InstallKeybdHook

AutoTrim, Off

; Ineuw's copy March 18, 2015
;==============================================
; Multipurpose keys
;------------------

;Win+z  mutipurpose assignments
#z::
Sendinput, {{}{{}rh||{{}{{}smaller|ONZIÈME LETTRE.{}}{}}|{}}{}}
Sendinput, {Home}{Right 5}
Return

; Permanent assignments
;----------------------

;Alt+1  }}
!1:: Sendinput, {raw}}}
Return

;Alt+2  {{}}
!2:: Sendinput, {{}{{}{}}{}}{Left 2}
Return

;Alt+3  {{ar|}}
!3:: Sendinput, {raw}{{ar|}}
Return

;Alt+4  {{Dhr}}{{rule|4em}}{{Dhr}}
!4:: Sendinput, {Home}{Enter}{{}{{}Dhr{}}{}}{Enter}{Enter}{{}{{}rule|4em{}}{}}{Enter}{Enter}{{}{{}Dhr{}}{}}{Enter}
Return

;Alt+5  {{Dhr}} {{rule|65%}}{{rule|65%}}{{Dhr}}
!5:: Sendinput, {{}{{}Dhr{}}{}}{Enter}{{}{{}rule|65`%{}}{}}{{}{{}rule|65`%{}}{}}{Enter}{{}{{}Dhr{}}{}}
Return

;Alt+6  {{Dhr}} {{rule|12em}} {{Dhr}}
!6:: Sendinput, {{}{{}Dhr{}}{}}{Enter}{Enter}{{}{{}rule|12em{}}{}}{Enter}{Enter}{{}{{}Dhr{}}{}}
Return

;Alt+7  {{c|{{fs75|selected text}}}}
!7::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{c|{{fs75|%Trimmed%}}}}
Sendinput, ^v
Return

;Alt+8  {{c|{{fs85|selected text}}}}
!8::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{c|{{fs85|%Trimmed%}}}}
Sendinput, ^v
Return

;Alt+9  {{c|{{fs90|selected text}}}}
!9::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{c|{{fs90|%Trimmed%}}}}
Sendinput, ^v
Return

;Alt+0  {{larger|selected text}}
!0::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{larger|%Trimmed%}}
Sendinput, ^v
Return

;Alt+Dn {{hwe|
!Down::
Sendinput, {raw}{{hwe|
Return

;Alt+Up {{hws|
!Up:: Sendinput, {raw}{{hws|
Return

;Alt+' ''selected text''
!'::
clipboard =
send ^c
clipwait, 1
varItalics := clipboard
        if SubStr(varItalics, 0, 1)= Chr(32) {
        varItalics := Trim(varItalics)
        clipboard = ''%varItalics%''%A_Space%
}
Else
{
        varItalics := Trim(varItalics)
        clipboard = ''%varItalics%''
}
Sendinput, ^v
Return

;Alt+a  [[Category:|]]
!a:: Sendinput, [[Category:]]{Left 2}
Return

;Alt+b '''selected text'''
!b::
clipboard =
send ^c
clipwait, 1
varBold := clipboard
        if SubStr(varBold, 0, 1)= Chr(32) {
        varBold := Trim(varBold)
        clipboard = '''%varBold%'''%A_Space%
}
Else
{
        varBold := Trim(varBold)
        clipboard = '''%varBold%'''
}
Sendinput, ^v
Return

;Alt+c  {{c|selected text}}
!c::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{c|%Trimmed%}}
Sendinput, ^v
Return

;Alt+d  {{Dhr}}
!d:: Sendinput, {raw}{{Dhr}}
Return

;Alt+e  | vertical bar at the beginning of the row for tables
!e:: Sendinput, {Home}|{Down}{Home}
Return

;Alt+f  FIS images container
!f::
Sendinput, {Home}{{}{{}FIS{Enter}
Sendinput, {Home} | file         = {Enter}
Sendinput, {Home} | width        = 500px|250px{Enter}
Sendinput, {Home} | cstyle       = margin-top:8px; margin-bottom:8px{Enter}
Sendinput, {Home} | float        = left|center|right{Enter}
Sendinput, {Home} | caption      = {Enter}
Sendinput, {Home} | talign       = center|justify{Enter}
Sendinput, {Home} | tstyle       = font-variant:small-caps; font-size:90`%{Enter}
Sendinput, {Home} | margin-right = 8px{Enter}
Sendinput, {Home} | margin-left  = 8px{Enter}
Sendinput, {Home} | tmleft       = 11px{Enter}
Sendinput, {Home} | indent       = -11px{Enter}
Sendinput, {Home}{}}{}}
Return

;Alt+g  {{gap}}
!g:: Sendinput, {raw}{{gap}}
Return

;Alt+h  {{fs70|{{sfrac||}}}} OR {{fs70|{{over||}}}} both are the same
!h::
Sendinput, {raw}{{fs70|{{sfrac||}}}}
Sendinput, {Left 5}
Return

;Alt+i  <i>selected text</i>
!i::
clipboard =
send ^c
clipwait, 1
varItalics := clipboard
        if SubStr(varItalics, 0, 1)= Chr(32) {
        varItalics := Trim(varItalics)
        clipboard = <i>%varItalics%</i>%A_Space%
}
Else
{
        varItalics := Trim(varItalics)
        clipboard = <i>%varItalics%</i>
}

Sendinput, ^v
Return

;Alt+j  {{left|selected text|2em}}
!j:: Sendinput, {Home}{{}{{}left|{End}{raw}|2em}}
Return

;Alt+k |ptb.5 Table code
!k:: Sendinput, {raw}|ptb.5
Return

;Alt+l  {{Plr|selected text}}
!l::
clipboard =
send ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{Plr|%Trimmed%}}
Sendinput, ^v
Return

;Alt+m  em dash —
!m:: 
;KeyWait, m
Send, {Asc 0151}
;Sleep, 500
;Send, {Delete}
Return

;Alt+n  {{nop}}
!n:: Sendinput, {Home}{{}{{}nop{}}{}}
Return

;Alt+o  {{rh||'' ''|}}
!o:: 
Sendinput, {raw}{{rh||'' ''|}}
Sendinput, {Left 2}
Return

;Alt+p  {{rh||''THE POPULAR SCIENCE MONTHLY.''|}}
!p::
Sendinput, {raw}{{rh||''THE POPULAR SCIENCE MONTHLY.''|}}
Sendinput, {Home}{Right 5}
Return

;Alt+r  <ref>selected text</ref>
!r::
clipboard =
send ^c
clipwait, 1
selected := clipboard
selected := Trim(selected)
clipboard = <ref>%selected%</ref>
Sendinput, ^v
Return

;Alt+s  {{sc|selected text}}
!s::
clipboard =
Sendinput, ^c
clipwait, 1
varSmallCaps := clipboard
        if SubStr(varSmallCaps, 0, 1)= Chr(32) {
        varSmallCaps := Trim(varSmallCaps)
        clipboard = {{sc|%varSmallCaps%}}%A_Space%
}
Else
{
        varSmallCaps := Trim(varSmallCaps)
        clipboard = {{sc|%varSmallCaps%}}
}

Sendinput, ^v
Return

;Alt+t  ts|al
!t:: Sendinput, {{}{{}ts|{}}{}}{Left 2}
Return

;Alt+v  {{di|D}}rop initial at the beginning of the line
!v:: Sendinput, {Home}{{}{{}di|{Right}{}}{}}
Return

;Alt+w  width= table code
!w:: Sendinput, width= {Left 1}

;Alt+y  · 
!y:: Sendinput, {Asc 0183}
Return

;Alt+z {{image}}
!z:: Sendinput, {raw}{{image}}
Return

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

;Win+1  <section end=E />
#1:: Sendinput, `<section begin=E `/`>{Left 3}
Return

;Win+2  <section end=E /><section begin=B />{Left 3}
#2::
;Sendinput, {raw}{{Dhr}}
;Sendinput, {Enter}
;Sendinput, {{}{{}PSM rule{}}{}}
Sendinput, {Enter}
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+8  {{fs85|selected text}}
#8::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{fs85|%Trimmed%}}
Sendinput, ^v
Return

;Win+9  {{c|{{fs90|selected text}}}}
#9::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{fs90|%Trimmed%}}
Sendinput, ^v
Return

;win+0  {{c|{{fs|105%|''selected text''}}}}
#0::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{c|{{fs|105`%|''%Trimmed%''}}}}
Sendinput, ^v
Return

;win+-  {{fs|105%|{{sc|selected text}}}}
#-::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{fs|105`%|{{sc|%Trimmed%}}}}
Sendinput, ^v
Return

;Win+a  {{anchor|D}}
#a:: Sendinput, {Home}{{}{{}anchor|D{}}{}}{Left 2}
Return

;Win+b  <b>selected text</b>
#b::
clipboard =
send ^c
clipwait, 1
varBold := clipboard
        if SubStr(varBold, 0, 1)= Chr(32) {
        varBold := Trim(varBold)
        clipboard = <b>%varBold%</b>%A_Space%
}
Else
{
        varBold := Trim(varBold)
        clipboard = <b>%varBold%</b>
}

Sendinput, ^v
Return

;Win+c  {{color|red|selected text}}
#c::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{color|red|%Trimmed%}}
Sendinput, ^v
Return

;Win+d  <div {{ts|width:430px;|ma|aj|sm85|lh11|it}}>selected text</div>
#d::
clipboard =
send ^c
clipwait, 1
varDiv := clipboard
varDiv := Trim(varDiv)
clipboard = <div {{ts|width:430px;|ma|aj|sm85|lh11|it}}>`n%varDiv%`n</div>
Sendinput, ^v
Return

;Win+h  {{hi|selected text}}
#h::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{hi|%Trimmed%}}
Sendinput, ^v
Return

;Win+i  {{SIC|selected text||selected text|}}
#i::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{SIC|%Trimmed%|%Trimmed%}}
Sendinput, ^v
Return

;Win+n  &nbsp
#n:: Sendinput, {raw} 
Return

;Win+o  {{smaller|selected text}}
#o::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{smaller|%Trimmed%}}
Sendinput, ^v
Return

;Win+p  {{block center/s}}<poem style="line-height:105%; font-size:90%;">selected text</poem>{{block center/e}}
#p::
clipboard =
send ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = {{block center/s}}<poem style="line-height:105`%; font-size:90`%;">`n%Trimmed%`n</poem>{{block center/e}}
Sendinput, ^v
Return

;Win+q  SUBPAGENAME
#q:: Sendinput, {raw}{{SUBPAGENAME}}
Return

;Win+r  {{right|selected text|2em}}
#r:: Sendinput, {Home}{{}{{}right|{End}{raw}|2em}}
Return

;Win+s  {{smallrefs}}
#s:: Sendinput, {{}{{}smallrefs{}}{}}
Return

;Win+t {| {{ts|mc|sm85|lh1|ar|bc|bgt}} <!-- border --> table code
#t:: Sendinput, {{}| {{}{{}ts|mc|sm85|lh1|ar|bc|bgt{}}{}} <{!}-- border -->
Return

;Win+u  <sup>selected text</sup>
#u::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = `<sup`>%Trimmed%`</sup`>
;clipboard = `<sup`>%Trimmed%`</sup`>
Sendinput, ^v
;Sendinput, {Left 15}
Return

;Win+v  <sub>selected text</sub>
#v::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = `<sub`>%Trimmed%`</sub`>
Sendinput, ^v
Return

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

;Ctrl+\ Load edited and saved Authotkey.ahk
^\::Reload
Return

;Ctrl+i Cleaned image and improved contrast
^i:: Sendinput, {raw}Cleaned image and improved contrast
Return

;Ctrl+j Replaced Google copyright notice(s) with blank page(s)
^j:: Sendinput, {raw}Replaced Google copyright notice(s) with blank page(s)
Return

;Ctrl+k {{sic}}
^k:: Sendinput, {raw}{{sic}}
Return

;Ctrl+m <math></math>
^m:: Sendinput, <math></math>{Left 7}
Return

;Ctrl+o Popular Science Monthly/Contributors
;^o:: Sendinput, {raw}Popular Science Monthly/Contributors
;Return

;Ctrl+p {{ping|{{ROOTPAGENAME}}}}
^p:: Sendinput, {raw}{{ping|{{ROOTPAGENAME}}}}
Return

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

;Alt+Shift+a     {{color|red|''Arabic missing''}}
!+a:: Sendinput, {raw}{{color|red|''Arabic missing''}}
Return

;Alt+Shift+b     <br />
!+b:: Sendinput, `<br `/`>
Return

;Alt+Shift+h     {{he|}} hebrew
!+h:: Sendinput, {{}{{}he|{}}{}}{Left 2}
Return

;Alt+Sift+l      Do not use - reserved by Windows

;Alt+Shift+w     {{PSM link|T|V|M&Y|author=}}
!+w:: Sendinput, {{}{{}PSM link|T|V|M&Y|author={}}{}}
Return

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

;CtrlShift+8    {{fs85/se}}
^+8:: Sendinput, {raw}{{fs85/se}}
Return

;CtrlShift+9    {{fs90/se}}
^+9:: Sendinput, {raw}{{fs90/se}}
Return

;CtrlShift+b  |pb.5 table code
^+b:: Sendinput, {raw}|pb.5
Return

;CtrlShift+i    [[selected text|selected text]]
^+i::
clipboard =
Sendinput, ^c
clipwait, 1
Trimmed := clipboard
Trimmed := Trim(Trimmed)
clipboard = [[%Trimmed%|%Trimmed%]]
Sendinput, ^v
Return

;CtrlShift+l    colspan= table code
^+l:: Sendinput, colspan= {Left 1}
Return

;CtrlShift+n    {{under construction}}
^+n:: Sendinput, {raw}{{under construction}}
Return

;CtrlShift+p    <p>
^+p:: Sendinput, {raw}<p>
Return

;CtrlShift+t  |pt.5 table code
^+t:: Sendinput, {raw}|pt.5
Return

;CtrlShift+u    {{fs85|{{ua|note=hyphenated word was joined on the previous page because of the intervening image.~~~~}}}}
^+u:: Sendinput, {{}{{}fs85|{{}{{}ua|note=hyphenated word was joined on the previous page because of the intervening image.~~~~}}}}{}}{}}{}}{}}
Return

;CtrlShift+w    rowspan= table code
^+w:: Sendinput, rowspan= {Left 1}
Return

;CtrlShift+y    {Asc 0186} º degree indicator
^+y:: Sendinput, {Asc 0186}
Return

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