mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 106
L
Vogon poet
OP Offline
Vogon poet
L
Joined: Feb 2003
Posts: 106
To send keystrokes from an alias I use the following code:
Code:
alias sendkeys {
  var %object = sendkeys $+ $ticks
  .comopen %object WScript.Shell
  if ($com(%object)) { .comclose %object $com(%object,SendKeys,3,bstr,$1-) }
}
e.g. sendkeys % $+ r will open the scripts editor

The following code in my dialog works for me:
Code:
on 1:dialog:myDialog:*:*: {
  if (($did == 1) && ($devent == sclick)) { echo -a you clicked   button1 }
  if (($did == 2) && ($devent == sclick)) { run notepad }
}


But this code does not perform as I would wish.
Code:
on 1:dialog:myDialog:*:*: {
  if (($did == 1) && ($devent == sclick)) { sendkeys % $+ r }
}

How can I make it work?


-
Just because it never happened doesn't mean it isn't true.
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Simply call /showmirc -s before /sendkeys

Joined: Feb 2003
Posts: 106
L
Vogon poet
OP Offline
Vogon poet
L
Joined: Feb 2003
Posts: 106
So it was as simple as that!
You make the calling program the active application.
My heartfelt thanks go to you, Hixxy


-
Just because it never happened doesn't mean it isn't true.

Link Copied to Clipboard