Brayden Willenborg
Brayden Willenborg

Reputation: 71

AutoHotKey: Press some buttons, type some text, press more buttons

I'm writing up an AutoHotKey script, and I am having a few problems.

This is what I want to do...

...This is what I came up with, and it failed.

:*://cpp/cd::
send {PgUp}
send {Home}
(
#ifndef CLASS_H
#define CLASS_H
)
send {PgDn}
send {Home}
(
#endif
)
return 

Upvotes: 0

Views: 781

Answers (1)

nzrp
nzrp

Reputation: 152

send converts # to WIN keystroke, so you should write {#} instead:

:*://cpp/cd::
send {PgUp}
send {Home}
(
{#}ifndef CLASS_H {Enter} {#}define CLASS_H {Enter}
)
Sleep,100 // wait a little if there is no effect
send {PgDn}
send {Home}
(
{#}endif {Enter}
)
return 

Particularly #d works like WIN+D and shows the desktop.

Upvotes: 1

Related Questions