up vote 1 down vote favorite
share [g+] share [fb]

I have the following autohotkey script:

::aaim::==aim{ENTER}int{ENTER}{ENTER}12{UP}{HOME}

which produces this:

==aim
int

12

however, to execute it I have to type aaim**SPACE** which then puts a space after where I want my cursor to be, like this:

==aim
int
 |
12

How can tell autohotkey to not include the SPACE the executes the script?

link|improve this question

70% accept rate
feedback

4 Answers

up vote 2 down vote accepted

:*:aaim::

Replace the first bit with that. It'll now fire when you type aaim, and nothing else. (That might be a little annoying if you're typing something that begins with aaim, but it's smart enough to not do it in the middle of words)

link|improve this answer
feedback

You could also avoid typing most of the spacing manually and use brackets, they will retain spaces:

:r0*:aaim::
(
==aim
int

12
{Left}{Up}
)
link|improve this answer
feedback

::aaim::==aim{ENTER}int{ENTER}{ENTER}12{UP}{HOME}{BACKSPACE}

There.

link|improve this answer
A roundabout, slightly hacky, but above all working method! +1, because who cares if our coding is perfect :P – Phoshi Oct 27 '09 at 12:11
feedback

There is actually a function in AutoHotkey specifically for this purpose. "Omit" Note the O in the hotstring below:

:O:aaim::==aaim etc... etc...

For more information, open the AutoHotkey help file and click on "Hotstrings & auto-replace" in the contents menu. Omit is listed under the Options headline.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.