Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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)

share|improve this answer

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

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

12
{Left}{Up}
)
share|improve this answer

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.

share|improve this answer

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

There.

share|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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .