Spoiler
If you want to use the script yourself.
Code:
;What you need to know: 0.4
;" becomes “ and ”
;alt+' becomes ‘ and ’
;Tab becomes ' ' Which are blank unicode characters
;Ctrl+b,i,u,t,h for bold, italic, underline, strikethrough, and url.
;pressing . three times quickly makes … instead of ...
;pressing - two times quickly makes — instead of --
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
global checked := 0
global curlyswap := 0
global singleswap := 0
global elipsis := 0
global emdash := 0
Gui, New, +ToolWindow +AlwaysOnTop,
Gui +LastFound
Gui, Add, Checkbox, vfix gWriterFix, Enable WriterFix
Gui, Show, ,
return
GuiClose:
ExitApp
Return
WriterFix:
GuiControlGet, fix
checked := fix
return
isChecked(x){
if(checked){
return
}
Send %x%
Exit
}
;Fancy Quote Maker
$+'::
isChecked("""") ;Autohotkey finds " scary. "" for escape and wrapped as a string.
if (curlyswap == 0){
Send “
curlyswap := 1
return
}else{
Send ”
curlyswap := 0
return
}
;Fancy Single Quote Maker
$!'::
isChecked("'")
if (singleswap == 0){
Send ‘
singleswap := 1
return
}else{
Send ’
singleswap := 0
return
}
;Elipsis Maker
$.::
isChecked(.)
if (elipsis == 0){
SetTimer, resetElipsis, 800
}
if (elipsis < 2){
elipsis++
send .
return
}else{
Send {BackSpace}
Send {BackSpace}
Send {…}
elipsis := 0
return
}
;EmDash Maker
$-::
isChecked("-")
if (emdash == 0){
SetTimer, resetEmdash, 400
}
if (emdash < 1){
emdash++
send -
return
}else{
Send {BackSpace}
Send {—}
emdash := 0
return
}
resetEmdash:
emdash := 0
return
resetElipsis:
elipsis := 0
return
$Tab::
isChecked("`t")
send ;Unicode Blank Spaces for tab replacement.
return
bbcode(tagA,tagB){
isChecked("")
oldClip := clipboard
clipboard := ""
Send, ^c
ClipWait,0
Send, [%tagA%]%clipboard%[/%tagB%]
clipboard := oldClip
return
}
;Bold hotkey ctrl+b
$^b::
bbcode("b","b")
return
;Url Hotkey ctrl+h
$^h::
bbcode("url=","url")
return
;Italic Hotkey ctrl+i
$^i::
bbcode("i","i")
return
;Underline Hotkey ctrl+u
$^u::
bbcode("u","u")
return
;Strikethrough Hotkey ctr+t
$^t::
bbcode("s","s")
return