A Simple Way to Make Abbreviations Work for Newbies

Helpful script writing tricks and HowTo's
PADRAK
Posts: 2
Joined: 19 Oct 2015, 00:17

A Simple Way to Make Abbreviations Work for Newbies

19 Oct 2015, 00:46

[code=autohotkey file=Untitled.ahk][/code]

Today I decided to learn about AutoHotkey and make it work.
I have a PhD in Physics from the 1970s, and I am an expert with computers and HTML,
So I thought that this was going to be very easy...
Boy was I wrong!

First of all, there are LOTS of websites still up that advertize AutoHotKey, and some different ways to program it.
I did not know about this website, which is the CORRECT website to download AutoHotKey from,
So I first downloaded it from some other website that automatically copied it into the C:\Windows folder and did not work at all.
I spent like 2 hours messing with that.

Finally I found this AHKSCRIPT.org website, which automatically loads the code into C:\Program Files - and
I was FINALLY able to right click on the Desktop, choose New, and create my first Script file on the Desktop: New AutoHotkey Script.ANK -
Right clicking on that icon makes everything else happen. Yea!

All I wanted to do is make an abbreviations (abbrs) file so that I don't have to retype my email address like 10 times a day.
The ONLY way I could get that to work was by using either of these single line commands
(; denote comment lines):

; Email Address that needs to be followed by a Space Bar or a Return
::!em::[myemailaddress@abc.xyz]
; or
; Email Address that occurs on the last char typed
:*:!em::[myemailaddress@abc.xyz]

So I made a list of lots of commands to fill in my personal data for forms, orders, etc.

NOW - Where can I find great big files that also correct all of the misspelled words that I usually mistype?

FINALLY - HOW TO DO THIS FOR NEWBIES

You all need to post a HOW TO DO THIS FOR NEWBIES file,
So I volunteer mine below as a start.

AND:

Thank you all for making the website work as good it does now!
Cheers and Hugs!

We All Need "How To Easily Do It" files for us new users.
Make It So.

; AutoHotkey Script by PADRAK 10.18.15
;
; Replace each [text] below with your proper text as you wish.
; Do not include the []s.
;
; Typing the abbr character string between the ::-:: sends that text to wherever
; the curser is after you press the Space Bar or Return.
; ANY TIME!
; I defined these abbrs below because they do not match any english words.
; There is also a way to use ^q:: which would mean (Ctrl q) pressed together, but
; Those types of commands would replace any MS Windows defaults (like ^s for Save).
; If any two defined abbrs are the same, then the first one defined wins.
;
; To get your free AutoHotkey program and to install it, download it from ONLY
; http://ahkscript.org
; IT MUST be installed in the normal default C: Program Files AutoHotkey folder, so check that!
;
; After installing AutoHotkey - Taken from the AutoHotkey Help File that you automatically get:
; To create your AutoHotkey Script file:
; 1. Right-Click on your desktop.
; 2. Find "New" in the menu.
; 3. Click "AutoHotkey Script" inside the "New" menu.
; 4. Give the script a new name. Note: It must end with a .ahk extension. Ex. MyScript.ahk
; 5. Find the newly created file on your desktop and Right-Click it.
; 6. Click "Edit Script".
; 7. A window should have popped up, probably Notepad. If so, SUCCESS!
; This is also found at:
; http://ahkscript.org/docs/Tutorial.htm#s12
;
; Explanations:
;
; Each :: line is a seperate definition code line.
; Lines that start with ; are comments (like these).
; ::abbr:: means that typing abbr is the hot key text to be typed to send that [text], AND
; The abbr must be followed by a Space or Return (or other specified key).
; :*:abbr:: means that as soon as abbr is typed, the text will immediately be sent, and
; No following key is needed to send.
; This is the one that could get you into trouble by replacing your normal typing anywhere.
; So choose wisely, like :*:!z:: for using the keystrokes !z just like that.
;
; Getting my first Script File to work was a real pain. It took me over 3 hours...
; I was using the code from the wrong website!
; Script Files have the extension .ANK and can be edited using the default Notepad app, by:
; Right click on a Script File to choose Edit, Compile, or Run.
; I use a seperate Master Text (*.txt) file to type up my Script File, and
; Then I use Copy, and then Paste that into the Script File that I opened with Right-click Edit.
; After Editing any Script File, be sure to Save it!
; You can store your Script Files.ANK anywhere and with any name (keep the .ANK). Desktop for me.
; Double-click the Script File to execute it. That will also Compile it.
; For these text replacement short cuts below, you only need just the one Script File.
; The abbreviations will last after you execute the file until you ShutDown.
; Also, the Help File says:
; There is a folder in the Start Menu called Startup.
; If you put a shortcut to your script in that folder,
; that script will launch automatically every time you start your PC.
;
; That's it. Have Fun!
;
; The file to copy into your Script File is now listed below:
;
;---------------------------------------------------------------------------------------
; Headers that were automatically Installed are these:
;
#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.
;
;---------------------------------------------------------------------------------------
;
;---------------------------------------------------------------------------------------
; To force new reloads without any messages
#SingleInstance force
;---------------------------------------------------------------------------------------
;
; PGB codes using prefix !
;
; My Name
::!mn::[My Name]
;
; Email Address
:*:!em::[myemailaddress@abc.xyz]
;
; Address1
::!ad1::[my mailing address line1]
;
; Address2
::!ad2::[my mailing address line2]
;
; City, State zip
::!csz::[my mail city, state, zip]
;
; City Only
::!co::[my mail city]
;
; State Only
::!so::[my mail state]
;
; zip Only
::!zo::[my mail zip]
;
; Cell Phone Number
::!cp::[my cell phone number]
;
; Home Phone Number
::!hp::[my home phone number]
;
; Password for website abc
::!pwabc::[my password for website abc]
;
;--------------------------------------------------------------------------------

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 6 guests