Yes, that will work.
You could however, reuse that same other script. You dont need to make a second function.
You could also do this (and get rid of the script file all together):
<alias
match="ii *"
enabled="y"
expand_variables="y"
sequence="99"
send_to="12"
>
<send>send "o all bash %1"
setvariable "target", "%1"</send>
</alias>
See how that works? with the sendto:script and then the stuff the alias does changed into a script (with the world.send). Its the preferred method now, since its more modular (and you wont have a nightmare when/if you convert to a plugin).
And with your old target alias, you can do something similar, with the send to and have to send to "variable" and then set your variable without having to call a script function at all. (Sendto: variable, send: %1, variable: target)
Alright, now that Ive finished preaching the newfangled send to script. There are times when you want to use old fasioned script files. This would be one.
Turn your alias into a regexp, that looks like this:
^ii([ ](.*))?$
then that will match on ii or ii target.
then in your script you can check to see if your wildcard array has a value or not (check the length) and if so, use it (and set a target value), if not, use your stored variable. |