 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
twwilliams
Joined: 24 May 2004 Posts: 23 Location: Bellevue, WA USA
|
Posted: Sun Jun 13, 2004 4:58 pm Post subject: Smart quotation marks and em dashes in BlogJet |
|
|
I've recently started using BlogJet to post to my blog, but it has one limitation: it doesn't have any way to enter "smart" quotation marks and other typographically-correct symbols (such as em dashes).
So I wrote this script that makes it behave like Microsoft Word with its autoformat as you type capabilities:
| Code: |
#SingleInstance
SetBatchLines, 10ms
SetKeyDelay, -1
enabled = 1
blogJetAndEnabled = 0
inQuotedString = 0
#F12::
If enabled = 1
{
ToolTip, Typography disabled
SetTimer, RemoveToolTip, 1000
enabled = 0
}
else
{
ToolTip, Typography enabled
SetTimer, RemoveToolTip, 1000
enabled = 1
}
return
~'::
Gosub, CheckForBlogJet
If blogJetAndEnabled = 1
Send, {backspace}{ASC 0146}
return
~"::
Gosub, CheckForBlogJet
If blogJetAndEnabled = 1
{
If inQuotedString = 0
{
;not in a quoted string
Send, {backspace}{ASC 0147}
inQuotedString = 1
}
else
{
;in a quoted string
Send, {backspace}{ASC 0148}
inQuotedString = 0
}
}
return
~-::
Gosub, CheckForBlogJet
If blogJetAndEnabled = 1
{
MatchChar = -
Input, UserInput, VT2L1, {esc}{tab}, -
if UserInput = -
Send, {backspace 2}{ASC 0151}
}
return
CheckForBlogJet:
IfWinActive, Tommy Blogs - BlogJet
blogJetAndEnabled = 1
else
blogJetAndEnabled = 0
If enabled = 0
blogJetAndEnabled = 0
return
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
|
_________________ Tommy |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sun Jun 13, 2004 5:46 pm Post subject: |
|
|
| Looks interesting. It's great that someone's used the Input command for something other than auto-replace (abbreviation expansion). |
|
| Back to top |
|
 |
twwilliams
Joined: 24 May 2004 Posts: 23 Location: Bellevue, WA USA
|
Posted: Sun Jun 13, 2004 7:54 pm Post subject: |
|
|
Well, even my use of the Input command is just a variation on auto-replace, since I'm turning -- into an em dash.
But I could imagine turning Input into something like ActiveWords (http://www.activewords.com/) where you can type a word anywhere, and it can become an autoreplace value, or a trigger to launch another process. _________________ Tommy |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Wed Jun 16, 2004 2:32 am Post subject: |
|
|
| ActiveWords sounds interesting. I hope to make auto-replace a more intrinsic feature of AHK in future versions: Something that supports a set of configurable end-word punctation marks , while being easier to script than Input (Input will still have its uses because it is very flexible). With the ideas that others have shared with me, I'm starting visualize auto-replace as a subset of Rajat's "hot strings", which are basically abbreviations that trigger some type of action, whether it be auto-replace or launching a program. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|