Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

4 Answers 4

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

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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