 |
tolan182 Newbie
Joined: 07 Feb 2008 Posts: 3
|
Posted: Sat Oct 04, 2008 5:15 am
Alias for trigger.. local var is not expanding |
Hi all,
My alias is this:
#alias white($name) {#trigger {$name} {#cw white}}
but when I run white abc, $name is the trigger and not abc.
Also, I used to have a hotkey in zmud. It was a macro with a variable as the output. I would assign aliases to the variable and they would expland in zmud, but they don't in cmud. Any ideas there? Thanks. |
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4774 Location: Pensacola, FL, USA
|
Posted: Sat Oct 04, 2008 7:54 am |
did you try forcing it with %expand($name)
i tend to use the following:
#ALIAS white {#ADDITEM white {%params}}
#TR {{@white}} {#CW white}
for the macroes try:
#EXEC {aliasname} |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Oct 04, 2008 8:00 am |
Your first seems to be a bug, but I think it'd be much simpler if you used a variable to contain your list of names and used a single trigger, like so:
#alias white($name) {#additem WhiteList $name}
#trigger {{@WhiteList}} {#cw white}
This way you have fewer triggers trying to match at once, fewer triggers clogging up your view in the package editor and best of all, it's trivial to remove someone again - just use #delitem.
Your second seems to be working just find in CMUD 2.36, is that your version?
#key {CTRL-8} {@test}
test=boo
press ctrl and 8 at the top of the keyboard, and presto.
EDIT: One thing that might be causing it, thinking about it, is if you created the macro using the package editor. You need to put your cursor in the Key box, press enter and THEN press the key. Just pressing it will put the actual character in there and not the internal name of the key - you'll see what I mean if you use it to set macros for the numpad. |
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4774 Location: Pensacola, FL, USA
|
Posted: Sat Oct 04, 2008 8:13 am |
heh, copycat, and welcome back Fang.
|
|
_________________ Discord: Shalimarwildcat |
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Oct 04, 2008 12:40 pm |
Actually, another easy way to do this is the following:
#ALIAS white($name) {#EXEC {%concat("#TRIGGER {",$name,"} {#CW white}")}
*shrug* But Fang is correct - it's much easier to do it like he's got it because it'll create far less triggers and you can easily remove a name without having to search through possibly hundreds of triggers for a name in your list.
Charneus |
|
|
|
 |
tolan182 Newbie
Joined: 07 Feb 2008 Posts: 3
|
Posted: Sun Oct 05, 2008 8:42 pm |
Thanks a lot! I used Fang's solution for the first one and it works great and then adding #exec fixed the other one, Shalimar.
|
|
|
|
 |
|
|
|