Reputation: 152
I was going through AHK documentation on hotstrings, and found the Options section particularly interesting
The one question I have is about turning off options, for example:
C: Case sensitive: When you type an abbreviation, it must exactly match the case defined in the script. Use C0 to turn case sensitivity back off.
There are no examples of how you would do this, so that is my first question
How would you do it?
That is, what are the steps and some code examples I could use to accomplish it?
As for the second question, one that is not as important
Why would you do it?
Upvotes: 0
Views: 185
Reputation: 2344
To answer your first question, there are two main ways of creating a Case-sensitive hotstring.
Stick the options between the first and second colons of the hotstring. Ex:
;Case Sensitive
:C:ROFL:: Rolling on floor laughing
:C:ICYMI:: In case you missed it
:C:TL;DR:: Too long, didn’t read
;Non case-sensitive
::atot::A Tale of Two Cities
::ctbc::Cry, the Beloved Country
#Hotstring
directiveIf you have a longer list of hotstrings you want some certain properties to apply to, you can use this directive. The directive will apply to all hotstrings following it, which is why there exists options like #Hotstring C0
that can turn off a previously declared #Hotstring C
. Ex:
#Hotstring C
::ROFL:: Rolling on floor laughing
::ICYMI:: In case you missed it
::TL;DR:: Too long, didn’t read
#Hotstring C0
::atot::A Tale of Two Cities
::ctbc::Cry, the Beloved Country
(Both of these code blocks are functionally identical)
To answer your second question, if you meant why would you need to use the C0
option, please see Method 2
above. If you meant why would you use the Case Options in general, that would be a matter of personal preferences.
Upvotes: 2